From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 00:18:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BED64106566B; Sun, 25 Apr 2010 00:18:39 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (unknown [IPv6:2001:470:1f09:679::1]) by mx1.freebsd.org (Postfix) with ESMTP id 81B708FC08; Sun, 25 Apr 2010 00:18:39 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 6D9D6C400C; Sun, 25 Apr 2010 00:18:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on muon.cran.org.uk X-Spam-Level: X-Spam-Status: No, score=-2.8 required=8.0 tests=AWL,BAYES_00,RDNS_DYNAMIC autolearn=no version=3.2.5 Received: from core.draftnet (87-194-158-129.bethere.co.uk [87.194.158.129]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA; Sun, 25 Apr 2010 00:18:38 +0000 (UTC) From: Bruce Cran To: Luigi Rizzo Date: Sun, 25 Apr 2010 01:18:36 +0100 User-Agent: KMail/1.13.2 (FreeBSD/9.0-CURRENT; KDE/4.4.2; amd64; ; ) References: <201004121637.o3CGbjSK080066@svn.freebsd.org> In-Reply-To: <201004121637.o3CGbjSK080066@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201004250118.36906.bruce@cran.org.uk> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206497 - in head: sbin/geom/class sbin/geom/class/sched sys/geom/sched sys/modules/geom sys/modules/geom/geom_sched sys/modules/geom/geom_sched/gs_sched sys/modules/geom/geom_sched/gsc... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Apr 2010 00:18:39 -0000 On Monday 12 April 2010 17:37:45 Luigi Rizzo wrote: > Author: luigi > Date: Mon Apr 12 16:37:45 2010 > New Revision: 206497 > URL: http://svn.freebsd.org/changeset/base/206497 > > Log: > Bring in geom_sched, support for scheduling disk I/O requests > in a device independent manner. Also include an example anticipatory > scheduler, gsched_rr, which gives very nice performance improvements > in presence of competing random access patterns. The example in gsched(8) says to use "-s rr", but it looks like it should be "-a rr"? -- Bruce Cran From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 00:54:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1138D106564A; Sun, 25 Apr 2010 00:54:12 +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 DB9638FC0C; Sun, 25 Apr 2010 00:54: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 o3P0sBG0097325; Sun, 25 Apr 2010 00:54:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3P0sB3C097323; Sun, 25 Apr 2010 00:54:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201004250054.o3P0sB3C097323@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 25 Apr 2010 00:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207178 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 00:54:12 -0000 Author: marcel Date: Sun Apr 25 00:54:11 2010 New Revision: 207178 URL: http://svn.freebsd.org/changeset/base/207178 Log: Fix undo for schemes that have internal partitions. Internal partitions do not constitute user-visible or active partitions and as such should not prevent undoing pending operations. While here, initialize the last usable sector for the placeholder geom based on the null scheme, created to allow undoing the destruction of a scheme. This gives consistent output with "gpart show". Based on a patch from: "Andrey V. Elsukov" Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun Apr 25 00:05:51 2010 (r207177) +++ head/sys/geom/part/g_part.c Sun Apr 25 00:54:11 2010 (r207178) @@ -855,7 +855,9 @@ g_part_ctl_delete(struct gctl_req *req, static int g_part_ctl_destroy(struct gctl_req *req, struct g_part_parms *gpp) { + struct g_consumer *cp; struct g_geom *gp; + struct g_provider *pp; struct g_part_entry *entry; struct g_part_table *null, *table; struct sbuf *sb; @@ -885,6 +887,11 @@ g_part_ctl_destroy(struct gctl_req *req, null->gpt_gp = gp; null->gpt_scheme = &g_part_null_scheme; LIST_INIT(&null->gpt_entry); + + cp = LIST_FIRST(&gp->consumer); + pp = cp->provider; + null->gpt_last = pp->mediasize / pp->sectorsize - 1; + null->gpt_depth = table->gpt_depth; null->gpt_opened = table->gpt_opened; null->gpt_smhead = table->gpt_smhead; @@ -1141,10 +1148,16 @@ g_part_ctl_undo(struct gctl_req *req, st table->gpt_created) ? 1 : 0; if (reprobe) { - if (!LIST_EMPTY(&table->gpt_entry)) { + LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { + if (entry->gpe_internal) + continue; error = EBUSY; goto fail; } + while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) { + LIST_REMOVE(entry, gpe_entry); + g_free(entry); + } error = g_part_probe(gp, cp, table->gpt_depth); if (error) { g_topology_lock(); From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 01:56:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1392F1065674; Sun, 25 Apr 2010 01:56:32 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0231F8FC0A; Sun, 25 Apr 2010 01:56: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 o3P1uVVb011235; Sun, 25 Apr 2010 01:56:31 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3P1uVr9011232; Sun, 25 Apr 2010 01:56:31 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201004250156.o3P1uVr9011232@svn.freebsd.org> From: Rick Macklem Date: Sun, 25 Apr 2010 01:56:31 +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: r207180 - in stable/8/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 01:56:32 -0000 Author: rmacklem Date: Sun Apr 25 01:56:31 2010 New Revision: 207180 URL: http://svn.freebsd.org/changeset/base/207180 Log: MFC: r206818 Avoid extraneous recovery cycles in the experimental NFS client when an NFSv4 server reboots, by doing two things. 1 - Make the function that acquires a stateid for I/O operations block until recovery is complete, so that it doesn't acquire out of date stateids. 2 - Only allow a recovery once every 1/2 of a lease duration, since the NFSv4 server must provide a recovery grace period of at least a lease duration. This should avoid recoveries caused by an out of date stateid that was acquired for an I/O op. just before a recovery cycle started. Modified: stable/8/sys/fs/nfs/nfsclstate.h stable/8/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/fs/nfs/nfsclstate.h ============================================================================== --- stable/8/sys/fs/nfs/nfsclstate.h Sun Apr 25 01:36:46 2010 (r207179) +++ stable/8/sys/fs/nfs/nfsclstate.h Sun Apr 25 01:56:31 2010 (r207180) @@ -74,6 +74,7 @@ struct nfsclclient { #define NFSCLFLAGS_EXPIREIT 0x0040 #define NFSCLFLAGS_FIRSTDELEG 0x0080 #define NFSCLFLAGS_GOTDELEG 0x0100 +#define NFSCLFLAGS_RECVRINPROG 0x0200 struct nfsclowner { LIST_ENTRY(nfsclowner) nfsow_list; Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clstate.c Sun Apr 25 01:36:46 2010 (r207179) +++ stable/8/sys/fs/nfsclient/nfs_clstate.c Sun Apr 25 01:56:31 2010 (r207180) @@ -481,6 +481,13 @@ nfscl_getstateid(vnode_t vp, u_int8_t *n } /* + * Wait for recovery to complete. + */ + while ((clp->nfsc_flags & NFSCLFLAGS_RECVRINPROG)) + (void) nfsmsleep(&clp->nfsc_flags, NFSCLSTATEMUTEXPTR, + PZERO, "nfsrecvr", NULL); + + /* * First, look for a delegation. */ LIST_FOREACH(dp, NFSCLDELEGHASH(clp, nfhp, fhlen), nfsdl_hash) { @@ -1778,6 +1785,7 @@ nfscl_recover(struct nfsclclient *clp, s * block when trying to use state. */ NFSLOCKCLSTATE(); + clp->nfsc_flags |= NFSCLFLAGS_RECVRINPROG; do { igotlock = nfsv4_lock(&clp->nfsc_lock, 1, NULL, NFSCLSTATEMUTEXPTR); @@ -1794,9 +1802,10 @@ nfscl_recover(struct nfsclclient *clp, s error == NFSERR_STALEDONTRECOVER) && --trycnt > 0); if (error) { nfscl_cleanclient(clp); - clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID | - NFSCLFLAGS_RECOVER); NFSLOCKCLSTATE(); + clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID | + NFSCLFLAGS_RECOVER | NFSCLFLAGS_RECVRINPROG); + wakeup(&clp->nfsc_flags); nfsv4_unlock(&clp->nfsc_lock, 0); NFSUNLOCKCLSTATE(); return; @@ -2057,6 +2066,8 @@ nfscl_recover(struct nfsclclient *clp, s } NFSLOCKCLSTATE(); + clp->nfsc_flags &= ~NFSCLFLAGS_RECVRINPROG; + wakeup(&clp->nfsc_flags); nfsv4_unlock(&clp->nfsc_lock, 0); NFSUNLOCKCLSTATE(); NFSFREECRED(tcred); @@ -2316,6 +2327,7 @@ nfscl_renewthread(struct nfsclclient *cl struct ucred *cred; u_int32_t clidrev; int error, cbpathdown, islept, igotlock, ret, clearok; + uint32_t recover_done_time = 0; cred = newnfs_getcred(); NFSLOCKCLSTATE(); @@ -2324,8 +2336,21 @@ nfscl_renewthread(struct nfsclclient *cl for(;;) { newnfs_setroot(cred); cbpathdown = 0; - if (clp->nfsc_flags & NFSCLFLAGS_RECOVER) - nfscl_recover(clp, cred, p); + if (clp->nfsc_flags & NFSCLFLAGS_RECOVER) { + /* + * Only allow one recover within 1/2 of the lease + * duration (nfsc_renew). + */ + if (recover_done_time < NFSD_MONOSEC) { + recover_done_time = NFSD_MONOSEC + + clp->nfsc_renew; + nfscl_recover(clp, cred, p); + } else { + NFSLOCKCLSTATE(); + clp->nfsc_flags &= ~NFSCLFLAGS_RECOVER; + NFSUNLOCKCLSTATE(); + } + } if (clp->nfsc_expire <= NFSD_MONOSEC && (clp->nfsc_flags & NFSCLFLAGS_HASCLIENTID)) { clp->nfsc_expire = NFSD_MONOSEC + clp->nfsc_renew; From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 01:56:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDBAB106576C; Sun, 25 Apr 2010 01:56:41 +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 0AB878FC17; Sun, 25 Apr 2010 01:56: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 o3P1udbc011273; Sun, 25 Apr 2010 01:56:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3P1ud0K011271; Sun, 25 Apr 2010 01:56:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201004250156.o3P1ud0K011271@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 25 Apr 2010 01:56: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: r207181 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 01:56:41 -0000 Author: marcel Date: Sun Apr 25 01:56:39 2010 New Revision: 207181 URL: http://svn.freebsd.org/changeset/base/207181 Log: Re-calculate a geometry when reprobing as well. PR: kern/145452 Reported by: "Andrey V. Elsukov" Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun Apr 25 01:56:31 2010 (r207180) +++ head/sys/geom/part/g_part.c Sun Apr 25 01:56:39 2010 (r207181) @@ -1166,6 +1166,15 @@ g_part_ctl_undo(struct gctl_req *req, st return (0); } table = gp->softc; + + /* + * Synthesize a disk geometry. Some partitioning schemes + * depend on it and since some file systems need it even + * when the partitition scheme doesn't, we do it here in + * scheme-independent code. + */ + pp = cp->provider; + g_part_geometry(table, cp, pp->mediasize / pp->sectorsize); } error = G_PART_READ(table, cp); From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 12:35:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E330106564A; Sun, 25 Apr 2010 12:35:39 +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 541FF8FC1D; Sun, 25 Apr 2010 12:35: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 o3PCZdVG054840; Sun, 25 Apr 2010 12:35:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PCZdbr054838; Sun, 25 Apr 2010 12:35:39 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004251235.o3PCZdbr054838@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 25 Apr 2010 12:35: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: r207186 - 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: Sun, 25 Apr 2010 12:35:39 -0000 Author: jilles Date: Sun Apr 25 12:35:39 2010 New Revision: 207186 URL: http://svn.freebsd.org/changeset/base/207186 Log: sysctl(3): Update description of various kern.* variables. Also add xrefs for confstr(3) (as sysconf(3) but for strings) and kvm(3) (which is a more convenient way to access some of the variables). PR: 116480 MFC after: 1 week Modified: head/lib/libc/gen/sysctl.3 Modified: head/lib/libc/gen/sysctl.3 ============================================================================== --- head/lib/libc/gen/sysctl.3 Sun Apr 25 05:09:08 2010 (r207185) +++ head/lib/libc/gen/sysctl.3 Sun Apr 25 12:35:39 2010 (r207186) @@ -28,7 +28,7 @@ .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd February 21, 2010 +.Dd April 25, 2010 .Dt SYSCTL 3 .Os .Sh NAME @@ -325,7 +325,7 @@ information. .It "KERN_BOOTFILE string yes" .It "KERN_BOOTTIME struct timeval no" .It "KERN_CLOCKRATE struct clockinfo no" -.It "KERN_FILE struct file no" +.It "KERN_FILE struct xfile no" .It "KERN_HOSTID integer yes" .It "KERN_HOSTUUID string yes" .It "KERN_HOSTNAME string yes" @@ -342,14 +342,14 @@ information. .It "KERN_OSREV integer no" .It "KERN_OSTYPE string no" .It "KERN_POSIX1 integer no" -.It "KERN_PROC struct proc no" +.It "KERN_PROC node not applicable" .It "KERN_PROF node not applicable" .It "KERN_QUANTUM integer yes" .It "KERN_SAVED_IDS integer no" .It "KERN_SECURELVL integer raise only" .It "KERN_UPDATEINTERVAL integer no" .It "KERN_VERSION string no" -.It "KERN_VNODE struct vnode no" +.It "KERN_VNODE struct xvnode no" .El .Bl -tag -width 6n .It Li KERN_ARGMAX @@ -370,10 +370,8 @@ This structure contains the clock, stati frequencies, the number of micro-seconds per hz tick and the skew rate. .It Li KERN_FILE Return the entire file table. -The returned data consists of a single -.Va struct filehead -followed by an array of -.Va struct file , +The returned data consists of an array of +.Va struct xfile , whose size depends on the current number of such objects in the system. .It Li KERN_HOSTID Get or set the host ID. @@ -525,10 +523,8 @@ Note, the vnode table is not necessarily the system. The returned data consists of an array whose size depends on the current number of such objects in the system. -Each element of the array contains the kernel address of a vnode -.Va struct vnode * -followed by the vnode itself -.Va struct vnode . +Each element of the array consists of a +.Va struct xvnode . .El .Ss CTL_NET The string and integer information available for the CTL_NET level @@ -854,6 +850,8 @@ An attempt is made to set a read-only va A process without appropriate privilege attempts to set a value. .El .Sh SEE ALSO +.Xr confstr 3 , +.Xr kvm 3 , .Xr sysconf 3 , .Xr sysctl 8 .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 12:50:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5D1D106564A; Sun, 25 Apr 2010 12:50:30 +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 D58118FC15; Sun, 25 Apr 2010 12: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 o3PCoU8c058140; Sun, 25 Apr 2010 12:50:30 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PCoUv3058138; Sun, 25 Apr 2010 12:50:30 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004251250.o3PCoUv3058138@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 25 Apr 2010 12:50: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: r207187 - head/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Apr 2010 12:50:31 -0000 Author: jilles Date: Sun Apr 25 12:50:30 2010 New Revision: 207187 URL: http://svn.freebsd.org/changeset/base/207187 Log: kvm(3): Mention that some of the functions use sysctl(3) instead of kmem. Additionally, because of sysctl(3) use (which is generally good), behaviour for crash dumps differs slightly from behaviour for live kernels and this will probably never be fixed entirely, so weaken that claim. MFC after: 1 week Modified: head/lib/libkvm/kvm.3 Modified: head/lib/libkvm/kvm.3 ============================================================================== --- head/lib/libkvm/kvm.3 Sun Apr 25 12:35:39 2010 (r207186) +++ head/lib/libkvm/kvm.3 Sun Apr 25 12:50:30 2010 (r207187) @@ -32,7 +32,7 @@ .\" @(#)kvm.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 29, 2004 +.Dd April 25, 2010 .Dt KVM 3 .Os .Sh NAME @@ -46,12 +46,15 @@ The library provides a uniform interface for accessing kernel virtual memory images, including live systems and crash dumps. Access to live systems is via +.Xr sysctl 3 +for some functions, and .Xr mem 4 and .Xr kmem 4 +for other functions, while crash dumps can be examined via the core file generated by .Xr savecore 8 . -The interface behaves identically in both cases. +The interface behaves similarly in both cases. Memory can be read and written, kernel symbol addresses can be looked up efficiently, and information about user processes can be gathered. @@ -112,5 +115,6 @@ given descriptor. .Xr kvm_openfiles 3 , .Xr kvm_read 3 , .Xr kvm_write 3 , +.Xr sysctl 3 , .Xr kmem 4 , .Xr mem 4 From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 13:13:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DFB11065670; Sun, 25 Apr 2010 13:13:23 +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 4DF848FC1C; Sun, 25 Apr 2010 13:13: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 o3PDDNwD063237; Sun, 25 Apr 2010 13:13:23 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PDDNU2063235; Sun, 25 Apr 2010 13:13:23 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004251313.o3PDDNU2063235@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 25 Apr 2010 13:13: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: r207188 - head/bin/ln X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Apr 2010 13:13:23 -0000 Author: jilles Date: Sun Apr 25 13:13:23 2010 New Revision: 207188 URL: http://svn.freebsd.org/changeset/base/207188 Log: symlink(7): The ownership of symlinks is used by the system, in at least three ways, so do not say it is ignored: * who may delete/rename a symlink in a sticky directory * who may do lchflags(2)/lchown(2)/lchmod(2) * whose inode quota is charged MFC after: 1 week Modified: head/bin/ln/symlink.7 Modified: head/bin/ln/symlink.7 ============================================================================== --- head/bin/ln/symlink.7 Sun Apr 25 12:50:30 2010 (r207187) +++ head/bin/ln/symlink.7 Sun Apr 25 13:13:23 2010 (r207188) @@ -29,7 +29,7 @@ .\" @(#)symlink.7 8.3 (Berkeley) 3/31/94 .\" $FreeBSD$ .\" -.Dd March 31, 1994 +.Dd April 25, 2010 .Dt SYMLINK 7 .Os .Sh NAME @@ -138,8 +138,8 @@ an existing symbolic link can be changed and .Xr lutimes 2 system calls, respectively. -Of these, only the flags are used by the system; -the access permissions and ownership are ignored. +Of these, only the flags and ownership are used by the system; +the access permissions are ignored. .Pp The .Bx 4.4 From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 13:29:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B719E1065670; Sun, 25 Apr 2010 13:29:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6EA48FC15; Sun, 25 Apr 2010 13:29:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3PDTxr0066858; Sun, 25 Apr 2010 13:29:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PDTxRb066856; Sun, 25 Apr 2010 13:29:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004251329.o3PDTxRb066856@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 25 Apr 2010 13: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: r207189 - head/bin/ln X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Apr 2010 13:29:59 -0000 Author: jilles Date: Sun Apr 25 13:29:59 2010 New Revision: 207189 URL: http://svn.freebsd.org/changeset/base/207189 Log: symlink(7): Add lpathconf(2) and *at system calls. MFC after: 1 week Modified: head/bin/ln/symlink.7 Modified: head/bin/ln/symlink.7 ============================================================================== --- head/bin/ln/symlink.7 Sun Apr 25 13:13:23 2010 (r207188) +++ head/bin/ln/symlink.7 Sun Apr 25 13:29:59 2010 (r207189) @@ -103,19 +103,23 @@ the system call would return a file descriptor to the file .Dq afile . .Pp -There are nine system calls that do not follow links, and which operate +There are thirteen system calls that do not follow links, and which operate on the symbolic link itself. They are: .Xr lchflags 2 , .Xr lchmod 2 , .Xr lchown 2 , +.Xr lpathconf 2 , .Xr lstat 2 , .Xr lutimes 2 , .Xr readlink 2 , +.Xr readlinkat 2 , .Xr rename 2 , +.Xr renameat 2 , .Xr rmdir 2 , +.Xr unlink 2 , and -.Xr unlink 2 . +.Xr unlinkat 2 . Because .Xr remove 3 is an alias for @@ -123,9 +127,30 @@ is an alias for it also does not follow symbolic links. When .Xr rmdir 2 +or +.Xr unlinkat 2 +with the +.Dv AT_REMOVEDIR +flag is applied to a symbolic link, it fails with the error .Er ENOTDIR . .Pp +The +.Xr linkat 2 +system call does not follow symbolic links +unless given the +.Dv AT_SYMLINK_FOLLOW +flag. +.Pp +The following system calls follow symbolic links +unless given the +.Dv AT_SYMLINK_NOFOLLOW +flag: +.Xr fchmodat 2 , +.Xr fchownat 2 +and +.Xr fstatat 2 . +.Pp The owner and group of an existing symbolic link can be changed by means of the .Xr lchown 2 From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 13:55:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61A6A1065739; Sun, 25 Apr 2010 13:55:53 +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 D1DEF8FC1F; Sun, 25 Apr 2010 13:55: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 o3PDtq6x072937; Sun, 25 Apr 2010 13:55:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PDtqkK072935; Sun, 25 Apr 2010 13:55:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004251355.o3PDtqkK072935@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 25 Apr 2010 13:55: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: r207190 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 13:55:53 -0000 Author: jilles Date: Sun Apr 25 13:55:52 2010 New Revision: 207190 URL: http://svn.freebsd.org/changeset/base/207190 Log: unlinkat(2): unlinkat(AT_REMOVEDIR) fails with ENOTEMPTY like rmdir() for non-empty directories. POSIX permits both ENOTEMPTY and EEXIST, but we use the clearer ENOTEMPTY, following BSD tradition. MFC after: 1 week Modified: head/lib/libc/sys/unlink.2 Modified: head/lib/libc/sys/unlink.2 ============================================================================== --- head/lib/libc/sys/unlink.2 Sun Apr 25 13:29:59 2010 (r207189) +++ head/lib/libc/sys/unlink.2 Sun Apr 25 13:55:52 2010 (r207190) @@ -28,7 +28,7 @@ .\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd April 25, 2010 .Dt UNLINK 2 .Os .Sh NAME @@ -167,7 +167,7 @@ argument does not specify an absolute pa argument is neither .Dv AT_FDCWD nor a valid file descriptor open for searching. -.It Bq Er EEXIST +.It Bq Er ENOTEMPTY The .Fa flag parameter has the From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 15:04:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86330106564A; Sun, 25 Apr 2010 15:04:57 +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 5D1658FC19; Sun, 25 Apr 2010 15:04: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 o3PF4vcl088156; Sun, 25 Apr 2010 15:04:57 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PF4vDh088154; Sun, 25 Apr 2010 15:04:57 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201004251504.o3PF4vDh088154@svn.freebsd.org> From: Michael Tuexen Date: Sun, 25 Apr 2010 15:04: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: r207191 - 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: Sun, 25 Apr 2010 15:04:57 -0000 Author: tuexen Date: Sun Apr 25 15:04:57 2010 New Revision: 207191 URL: http://svn.freebsd.org/changeset/base/207191 Log: Undo my lastest fix since that wasn't one at all. MFC after: 3 days. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Apr 25 13:55:52 2010 (r207190) +++ head/sys/netinet/sctp_indata.c Sun Apr 25 15:04:57 2010 (r207191) @@ -3514,25 +3514,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->sent == SCTP_DATAGRAM_RESEND) { struct sctp_nets *alt; - if ((stcb->asoc.peer_supports_prsctp) && - (PR_SCTP_RTX_ENABLED(tp1->flags))) { - /* - * Has it been retransmitted tv_sec times? - - * we store the retran count there. - */ - if (tp1->snd_count > tp1->rec.data.timetodrop.tv_sec) { - /* Yes, so drop it */ - if (tp1->data != NULL) { - (void)sctp_release_pr_sctp_chunk(stcb, tp1, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), - SCTP_SO_NOT_LOCKED); - } - /* Make sure to flag we had a FR */ - tp1->whoTo->net_ack++; - tp1 = TAILQ_NEXT(tp1, sctp_next); - continue; - } - } /* fix counts and things */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_RSND, @@ -3555,6 +3536,25 @@ sctp_strike_gap_ack_chunks(struct sctp_t /* remove from the total flight */ sctp_total_flight_decrease(stcb, tp1); + if ((stcb->asoc.peer_supports_prsctp) && + (PR_SCTP_RTX_ENABLED(tp1->flags))) { + /* + * Has it been retransmitted tv_sec times? - + * we store the retran count there. + */ + if (tp1->snd_count > tp1->rec.data.timetodrop.tv_sec) { + /* Yes, so drop it */ + if (tp1->data != NULL) { + (void)sctp_release_pr_sctp_chunk(stcb, tp1, + (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), + SCTP_SO_NOT_LOCKED); + } + /* Make sure to flag we had a FR */ + tp1->whoTo->net_ack++; + tp1 = TAILQ_NEXT(tp1, sctp_next); + continue; + } + } /* printf("OK, we are now ready to FR this guy\n"); */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(tp1->rec.data.TSN_seq, tp1->snd_count, From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 16:16:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6CD8106566B; Sun, 25 Apr 2010 16:16:43 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D62D88FC17; Sun, 25 Apr 2010 16:16:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3PGGh2K004028; Sun, 25 Apr 2010 16:16:43 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PGGhF9004026; Sun, 25 Apr 2010 16:16:43 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201004251616.o3PGGhF9004026@svn.freebsd.org> From: Fabien Thomas Date: Sun, 25 Apr 2010 16:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207192 - stable/8/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Apr 2010 16:16:44 -0000 Author: fabient Date: Sun Apr 25 16:16:43 2010 New Revision: 207192 URL: http://svn.freebsd.org/changeset/base/207192 Log: MFC r206994: Apply threshold filter to root node in calltree view. Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Directory Properties: stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Sun Apr 25 15:04:57 2010 (r207191) +++ stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Sun Apr 25 16:16:43 2010 (r207192) @@ -499,9 +499,10 @@ void pmcpl_ct_topdisplay(void) { int i, x, y, pmcin; - struct pmcpl_ct_sample rsamples; + struct pmcpl_ct_sample r, *rsamples; - pmcpl_ct_samples_root(&rsamples); + rsamples = &r; + pmcpl_ct_samples_root(rsamples); PMCSTAT_PRINTW("%-10.10s %s\n", "IMAGE", "CALLTREE"); @@ -524,16 +525,20 @@ pmcpl_ct_topdisplay(void) if (PMCPL_CT_SAMPLE(pmcin, &pmcpl_ct_root->pct_arc[i].pcta_samples) == 0) continue; + if (PMCPL_CT_SAMPLEP(pmcin, + &pmcpl_ct_root->pct_arc[i].pcta_samples) <= + pmcstat_threshold) + continue; if (pmcpl_ct_node_dumptop(pmcin, pmcpl_ct_root->pct_arc[i].pcta_child, - &rsamples, x, &y, pmcstat_displayheight - 2)) { + rsamples, x, &y, pmcstat_displayheight - 2)) { break; } } - pmcpl_ct_node_printtop(&rsamples, pmcin, y); + pmcpl_ct_node_printtop(rsamples, pmcin, y); } - pmcpl_ct_samples_free(&rsamples); + pmcpl_ct_samples_free(rsamples); } /* From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 16:17:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDB80106566C; Sun, 25 Apr 2010 16:17:52 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD4188FC13; Sun, 25 Apr 2010 16:17: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 o3PGHqnm004336; Sun, 25 Apr 2010 16:17:52 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PGHqYG004334; Sun, 25 Apr 2010 16:17:52 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201004251617.o3PGHqYG004334@svn.freebsd.org> From: Fabien Thomas Date: Sun, 25 Apr 2010 16:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207193 - stable/7/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Apr 2010 16:17:53 -0000 Author: fabient Date: Sun Apr 25 16:17:52 2010 New Revision: 207193 URL: http://svn.freebsd.org/changeset/base/207193 Log: MFC r206994: Apply threshold filter to root node in calltree view. Modified: stable/7/usr.sbin/pmcstat/pmcpl_calltree.c Directory Properties: stable/7/usr.sbin/pmcstat/ (props changed) Modified: stable/7/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- stable/7/usr.sbin/pmcstat/pmcpl_calltree.c Sun Apr 25 16:16:43 2010 (r207192) +++ stable/7/usr.sbin/pmcstat/pmcpl_calltree.c Sun Apr 25 16:17:52 2010 (r207193) @@ -499,9 +499,10 @@ void pmcpl_ct_topdisplay(void) { int i, x, y, pmcin; - struct pmcpl_ct_sample rsamples; + struct pmcpl_ct_sample r, *rsamples; - pmcpl_ct_samples_root(&rsamples); + rsamples = &r; + pmcpl_ct_samples_root(rsamples); PMCSTAT_PRINTW("%-10.10s %s\n", "IMAGE", "CALLTREE"); @@ -524,16 +525,20 @@ pmcpl_ct_topdisplay(void) if (PMCPL_CT_SAMPLE(pmcin, &pmcpl_ct_root->pct_arc[i].pcta_samples) == 0) continue; + if (PMCPL_CT_SAMPLEP(pmcin, + &pmcpl_ct_root->pct_arc[i].pcta_samples) <= + pmcstat_threshold) + continue; if (pmcpl_ct_node_dumptop(pmcin, pmcpl_ct_root->pct_arc[i].pcta_child, - &rsamples, x, &y, pmcstat_displayheight - 2)) { + rsamples, x, &y, pmcstat_displayheight - 2)) { break; } } - pmcpl_ct_node_printtop(&rsamples, pmcin, y); + pmcpl_ct_node_printtop(rsamples, pmcin, y); } - pmcpl_ct_samples_free(&rsamples); + pmcpl_ct_samples_free(rsamples); } /* From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 16:42:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00321106566B; Sun, 25 Apr 2010 16:42:47 +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 D9EBE8FC1A; Sun, 25 Apr 2010 16:42:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3PGglBT009837; Sun, 25 Apr 2010 16:42:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PGgleI009835; Sun, 25 Apr 2010 16:42:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004251642.o3PGgleI009835@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 25 Apr 2010 16:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207194 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 16:42:48 -0000 Author: kib Date: Sun Apr 25 16:42:47 2010 New Revision: 207194 URL: http://svn.freebsd.org/changeset/base/207194 Log: Provide 32bit compat shims for sysctl net.route NET_RT_IFLIST. This allows getifaddrs(3) to work for compat32 binaries. Submitted by: jhb (6.x version) Reviewed by: emaste Tested by: emaste and MFC after: 2 weeks Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Apr 25 16:17:52 2010 (r207193) +++ head/sys/net/rtsock.c Sun Apr 25 16:42:47 2010 (r207194) @@ -29,6 +29,7 @@ * @(#)rtsock.c 8.7 (Berkeley) 10/12/95 * $FreeBSD$ */ +#include "opt_compat.h" #include "opt_sctp.h" #include "opt_mpath.h" #include "opt_inet.h" @@ -71,6 +72,49 @@ extern void sctp_addr_change(struct ifad #endif /* SCTP */ #endif +#ifdef COMPAT_FREEBSD32 +#include +#include + +struct if_data32 { + uint8_t ifi_type; + uint8_t ifi_physical; + uint8_t ifi_addrlen; + uint8_t ifi_hdrlen; + uint8_t ifi_link_state; + uint8_t ifi_spare_char1; + uint8_t ifi_spare_char2; + uint8_t ifi_datalen; + uint32_t ifi_mtu; + uint32_t ifi_metric; + uint32_t ifi_baudrate; + uint32_t ifi_ipackets; + uint32_t ifi_ierrors; + uint32_t ifi_opackets; + uint32_t ifi_oerrors; + uint32_t ifi_collisions; + uint32_t ifi_ibytes; + uint32_t ifi_obytes; + uint32_t ifi_imcasts; + uint32_t ifi_omcasts; + uint32_t ifi_iqdrops; + uint32_t ifi_noproto; + uint32_t ifi_hwassist; + int32_t ifi_epoch; + struct timeval32 ifi_lastchange; +}; + +struct if_msghdr32 { + uint16_t ifm_msglen; + uint8_t ifm_version; + uint8_t ifm_type; + int32_t ifm_addrs; + int32_t ifm_flags; + uint16_t ifm_index; + struct if_data32 ifm_data; +}; +#endif + MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables"); /* NB: these are not modified */ @@ -1001,6 +1045,12 @@ again: break; case RTM_IFINFO: +#ifdef COMPAT_FREEBSD32 + if (w != NULL && w->w_req->flags & SCTL_MASK32) { + len = sizeof(struct if_msghdr32); + break; + } +#endif len = sizeof(struct if_msghdr); break; @@ -1367,6 +1417,38 @@ sysctl_dumpentry(struct radix_node *rn, return (error); } +#ifdef COMPAT_FREEBSD32 +static void +copy_ifdata32(struct if_data *src, struct if_data32 *dst) +{ + + bzero(dst, sizeof(*dst)); + CP(*src, *dst, ifi_type); + CP(*src, *dst, ifi_physical); + CP(*src, *dst, ifi_addrlen); + CP(*src, *dst, ifi_hdrlen); + CP(*src, *dst, ifi_link_state); + CP(*src, *dst, ifi_datalen); + CP(*src, *dst, ifi_mtu); + CP(*src, *dst, ifi_metric); + CP(*src, *dst, ifi_baudrate); + CP(*src, *dst, ifi_ipackets); + CP(*src, *dst, ifi_ierrors); + CP(*src, *dst, ifi_opackets); + CP(*src, *dst, ifi_oerrors); + CP(*src, *dst, ifi_collisions); + CP(*src, *dst, ifi_ibytes); + CP(*src, *dst, ifi_obytes); + CP(*src, *dst, ifi_imcasts); + CP(*src, *dst, ifi_omcasts); + CP(*src, *dst, ifi_iqdrops); + CP(*src, *dst, ifi_noproto); + CP(*src, *dst, ifi_hwassist); + CP(*src, *dst, ifi_epoch); + TV_CP(*src, *dst, ifi_lastchange); +} +#endif + static int sysctl_iflist(int af, struct walkarg *w) { @@ -1387,12 +1469,30 @@ sysctl_iflist(int af, struct walkarg *w) if (w->w_req && w->w_tmem) { struct if_msghdr *ifm; +#ifdef COMPAT_FREEBSD32 + if (w->w_req->flags & SCTL_MASK32) { + struct if_msghdr32 *ifm32; + + ifm32 = (struct if_msghdr32 *)w->w_tmem; + ifm32->ifm_index = ifp->if_index; + ifm32->ifm_flags = ifp->if_flags | + ifp->if_drv_flags; + copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); + ifm32->ifm_addrs = info.rti_addrs; + error = SYSCTL_OUT(w->w_req, (caddr_t)ifm32, + len); + goto sysctl_out; + } +#endif ifm = (struct if_msghdr *)w->w_tmem; ifm->ifm_index = ifp->if_index; ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm->ifm_data = ifp->if_data; ifm->ifm_addrs = info.rti_addrs; - error = SYSCTL_OUT(w->w_req,(caddr_t)ifm, len); + error = SYSCTL_OUT(w->w_req, (caddr_t)ifm, len); +#ifdef COMPAT_FREEBSD32 + sysctl_out: +#endif if (error) goto done; } From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 16:43:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B070C106564A; Sun, 25 Apr 2010 16:43:41 +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 A03E48FC1F; Sun, 25 Apr 2010 16:43: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 o3PGhfFh010071; Sun, 25 Apr 2010 16:43:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PGhf6U010068; Sun, 25 Apr 2010 16:43:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004251643.o3PGhf6U010068@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 25 Apr 2010 16:43: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: r207195 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 16:43:41 -0000 Author: kib Date: Sun Apr 25 16:43:41 2010 New Revision: 207195 URL: http://svn.freebsd.org/changeset/base/207195 Log: Provide compat32 shims for bpf(4), except zero-copy facilities. bd_compat32 field of struct bpf_d is kept unconditionally to not impose the requirement of including "opt_compat.h" on all numerous users of bpfdesc.h. Submitted by: jhb (version for 6.x) Reviewed and tested by: emaste MFC after: 2 weeks Modified: head/sys/net/bpf.c head/sys/net/bpfdesc.h Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Sun Apr 25 16:42:47 2010 (r207194) +++ head/sys/net/bpf.c Sun Apr 25 16:43:41 2010 (r207195) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bpf.h" +#include "opt_compat.h" #include "opt_netgraph.h" #include @@ -89,6 +90,43 @@ MALLOC_DEFINE(M_BPF, "BPF", "BPF data"); #define PRINET 26 /* interruptible */ +#ifdef COMPAT_FREEBSD32 +#include +#include +#define BPF_ALIGNMENT32 sizeof(int32_t) +#define BPF_WORDALIGN32(x) (((x)+(BPF_ALIGNMENT32-1))&~(BPF_ALIGNMENT32-1)) + +/* + * 32-bit version of structure prepended to each packet. We use this header + * instead of the standard one for 32-bit streams. We mark the a stream as + * 32-bit the first time we see a 32-bit compat ioctl request. + */ +struct bpf_hdr32 { + struct timeval32 bh_tstamp; /* time stamp */ + uint32_t bh_caplen; /* length of captured portion */ + uint32_t bh_datalen; /* original length of packet */ + uint16_t bh_hdrlen; /* length of bpf header (this struct + plus alignment padding) */ +}; + +struct bpf_program32 { + u_int bf_len; + uint32_t bf_insns; +}; + +struct bpf_dltlist32 { + u_int bfl_len; + u_int bfl_list; +}; + +#define BIOCSETF32 _IOW('B', 103, struct bpf_program32) +#define BIOCSRTIMEOUT32 _IOW('B',109, struct timeval32) +#define BIOCGRTIMEOUT32 _IOR('B',110, struct timeval32) +#define BIOCGDLTLIST32 _IOWR('B',121, struct bpf_dltlist32) +#define BIOCSETWF32 _IOW('B',123, struct bpf_program32) +#define BIOCSETFNR32 _IOW('B',130, struct bpf_program32) +#endif + /* * bpf_iflist is a list of BPF interface structures, each corresponding to a * specific DLT. The same network interface might have several BPF interface @@ -1005,8 +1043,14 @@ bpfioctl(struct cdev *dev, u_long cmd, c case BIOCFLUSH: case BIOCGDLT: case BIOCGDLTLIST: +#ifdef COMPAT_FREEBSD32 + case BIOCGDLTLIST32: +#endif case BIOCGETIF: case BIOCGRTIMEOUT: +#ifdef COMPAT_FREEBSD32 + case BIOCGRTIMEOUT32: +#endif case BIOCGSTATS: case BIOCVERSION: case BIOCGRSIG: @@ -1015,6 +1059,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c case FIONREAD: case BIOCLOCK: case BIOCSRTIMEOUT: +#ifdef COMPAT_FREEBSD32 + case BIOCSRTIMEOUT32: +#endif case BIOCIMMEDIATE: case TIOCGPGRP: case BIOCROTZBUF: @@ -1023,6 +1070,22 @@ bpfioctl(struct cdev *dev, u_long cmd, c return (EPERM); } } +#ifdef COMPAT_FREEBSD32 + /* + * If we see a 32-bit compat ioctl, mark the stream as 32-bit so + * that it will get 32-bit packet headers. + */ + switch (cmd) { + case BIOCSETF32: + case BIOCSETFNR32: + case BIOCSETWF32: + case BIOCGDLTLIST32: + case BIOCGRTIMEOUT32: + case BIOCSRTIMEOUT32: + d->bd_compat32 = 1; + } +#endif + CURVNET_SET(TD_TO_VNET(td)); switch (cmd) { @@ -1080,6 +1143,11 @@ bpfioctl(struct cdev *dev, u_long cmd, c case BIOCSETF: case BIOCSETFNR: case BIOCSETWF: +#ifdef COMPAT_FREEBSD32 + case BIOCSETF32: + case BIOCSETFNR32: + case BIOCSETWF32: +#endif error = bpf_setf(d, (struct bpf_program *)addr, cmd); break; @@ -1123,6 +1191,26 @@ bpfioctl(struct cdev *dev, u_long cmd, c /* * Get a list of supported data link types. */ +#ifdef COMPAT_FREEBSD32 + case BIOCGDLTLIST32: + { + struct bpf_dltlist32 *list32; + struct bpf_dltlist dltlist; + + list32 = (struct bpf_dltlist32 *)addr; + dltlist.bfl_len = list32->bfl_len; + dltlist.bfl_list = PTRIN(list32->bfl_list); + if (d->bd_bif == NULL) + error = EINVAL; + else { + error = bpf_getdltlist(d, &dltlist); + if (error == 0) + list32->bfl_len = dltlist.bfl_len; + } + break; + } +#endif + case BIOCGDLTLIST: if (d->bd_bif == NULL) error = EINVAL; @@ -1166,8 +1254,23 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Set read timeout. */ case BIOCSRTIMEOUT: +#ifdef COMPAT_FREEBSD32 + case BIOCSRTIMEOUT32: +#endif { struct timeval *tv = (struct timeval *)addr; +#ifdef COMPAT_FREEBSD32 + struct timeval32 *tv32; + struct timeval tv64; + + if (cmd == BIOCSRTIMEOUT32) { + tv32 = (struct timeval32 *)addr; + tv = &tv64; + tv->tv_sec = tv32->tv_sec; + tv->tv_usec = tv32->tv_usec; + } else +#endif + tv = (struct timeval *)addr; /* * Subtract 1 tick from tvtohz() since this isn't @@ -1182,11 +1285,31 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get read timeout. */ case BIOCGRTIMEOUT: +#ifdef COMPAT_FREEBSD32 + case BIOCGRTIMEOUT32: +#endif { - struct timeval *tv = (struct timeval *)addr; + struct timeval *tv; +#ifdef COMPAT_FREEBSD32 + struct timeval32 *tv32; + struct timeval tv64; + + if (cmd == BIOCGRTIMEOUT32) + tv = &tv64; + else +#endif + tv = (struct timeval *)addr; tv->tv_sec = d->bd_rtout / hz; tv->tv_usec = (d->bd_rtout % hz) * tick; +#ifdef COMPAT_FREEBSD32 + if (cmd == BIOCGRTIMEOUT32) { + tv32 = (struct timeval32 *)addr; + tv32->tv_sec = tv->tv_sec; + tv32->tv_usec = tv->tv_usec; + } +#endif + break; } @@ -1369,7 +1492,19 @@ bpf_setf(struct bpf_d *d, struct bpf_pro #ifdef BPF_JITTER bpf_jit_filter *ofunc; #endif - +#ifdef COMPAT_FREEBSD32 + struct bpf_program32 *fp32; + struct bpf_program fp_swab; + + if (cmd == BIOCSETWF32 || cmd == BIOCSETF32 || cmd == BIOCSETFNR32) { + fp32 = (struct bpf_program32 *)fp; + fp_swab.bf_len = fp32->bf_len; + fp_swab.bf_insns = (struct bpf_insn *)(uintptr_t)fp32->bf_insns; + fp = &fp_swab; + if (cmd == BIOCSETWF32) + cmd = BIOCSETWF; + } +#endif if (cmd == BIOCSETWF) { old = d->bd_wfilter; wfilter = 1; @@ -1771,6 +1906,9 @@ catchpacket(struct bpf_d *d, u_char *pkt struct timeval *tv) { struct bpf_hdr hdr; +#ifdef COMPAT_FREEBSD32 + struct bpf_hdr32 hdr32; +#endif int totlen, curlen; int hdrlen = d->bd_bif->bif_hdrlen; int do_wakeup = 0; @@ -1809,7 +1947,12 @@ catchpacket(struct bpf_d *d, u_char *pkt * buffer is considered immutable by the buffer model, try to rotate * the buffer and wakeup pending processes. */ - curlen = BPF_WORDALIGN(d->bd_slen); +#ifdef COMPAT_FREEBSD32 + if (d->bd_compat32) + curlen = BPF_WORDALIGN32(d->bd_slen); + else +#endif + curlen = BPF_WORDALIGN(d->bd_slen); if (curlen + totlen > d->bd_bufsize || !bpf_canwritebuf(d)) { if (d->bd_fbuf == NULL) { /* @@ -1831,6 +1974,22 @@ catchpacket(struct bpf_d *d, u_char *pkt * reader should be woken up. */ do_wakeup = 1; +#ifdef COMPAT_FREEBSD32 + /* + * If this is a 32-bit stream, then stick a 32-bit header at the + * front and copy the data into the buffer. + */ + if (d->bd_compat32) { + bzero(&hdr32, sizeof(hdr32)); + hdr32.bh_tstamp.tv_sec = tv->tv_sec; + hdr32.bh_tstamp.tv_usec = tv->tv_usec; + hdr32.bh_datalen = pktlen; + hdr32.bh_hdrlen = hdrlen; + hdr.bh_caplen = hdr32.bh_caplen = totlen - hdrlen; + bpf_append_bytes(d, d->bd_sbuf, curlen, &hdr32, sizeof(hdr32)); + goto copy; + } +#endif /* * Append the bpf header. Note we append the actual header size, but @@ -1846,6 +2005,9 @@ catchpacket(struct bpf_d *d, u_char *pkt /* * Copy the packet data into the store buffer and update its length. */ +#ifdef COMPAT_FREEBSD32 + copy: +#endif (*cpfn)(d, d->bd_sbuf, curlen + hdrlen, pkt, hdr.bh_caplen); d->bd_slen = curlen + totlen; Modified: head/sys/net/bpfdesc.h ============================================================================== --- head/sys/net/bpfdesc.h Sun Apr 25 16:42:47 2010 (r207194) +++ head/sys/net/bpfdesc.h Sun Apr 25 16:43:41 2010 (r207195) @@ -97,6 +97,7 @@ struct bpf_d { u_int64_t bd_wfcount; /* number of packets that matched write filter */ u_int64_t bd_wdcount; /* number of packets dropped during a write */ u_int64_t bd_zcopy; /* number of zero copy operations */ + u_char bd_compat32; /* 32-bit stream on LP64 system */ }; /* Values for bd_state */ From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 17:38:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA4BE106564A; Sun, 25 Apr 2010 17:38:53 +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 A07B48FC19; Sun, 25 Apr 2010 17:38: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 o3PHcrbR022189; Sun, 25 Apr 2010 17:38:53 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PHcrWh022186; Sun, 25 Apr 2010 17:38:53 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004251738.o3PHcrWh022186@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 25 Apr 2010 17:38: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: r207196 - in head: share/man/man1 usr.bin/alias X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Apr 2010 17:38:53 -0000 Author: jilles Date: Sun Apr 25 17:38:53 2010 New Revision: 207196 URL: http://svn.freebsd.org/changeset/base/207196 Log: Make hash, type and ulimit available via execve(). These are specified by POSIX but are not special builtins, and therefore need to be available via execve() and utilities like time, nohup, xargs. (Note that hash was moved from the XSI option to the base in the 2008 standard.) Like most of the POSIX "regular builtin commands", these need to be executed in a shell environment for full functionality, although they may still be of some use outside one. Unlike the POSIX special and regular builtin commands, POSIX does not require these to be found before a PATH search, although that could be an oversight. Like some of the utilities already provided by usr.bin/alias, these may lead to confusing results when invoked from csh(1). Modified: head/share/man/man1/builtin.1 head/usr.bin/alias/Makefile Modified: head/share/man/man1/builtin.1 ============================================================================== --- head/share/man/man1/builtin.1 Sun Apr 25 16:43:41 2010 (r207195) +++ head/share/man/man1/builtin.1 Sun Apr 25 17:38:53 2010 (r207196) @@ -245,7 +245,7 @@ but are implemented as scripts using a b .It Ic getopts Ta No** Ta \&No Ta Yes .It Ic glob Ta \&No Ta Yes Ta \&No .It Ic goto Ta \&No Ta Yes Ta \&No -.It Ic hash Ta \&No Ta \&No Ta Yes +.It Ic hash Ta No** Ta \&No Ta Yes .It Ic hashstat Ta \&No Ta Yes Ta \&No .It Ic history Ta \&No Ta Yes Ta \&No .It Ic hup Ta \&No Ta Yes Ta \&No @@ -290,8 +290,8 @@ but are implemented as scripts using a b .It Ic times Ta \&No Ta \&No Ta Yes .It Ic trap Ta \&No Ta \&No Ta Yes .It Ic true Ta Yes Ta \&No Ta Yes -.It Ic type Ta \&No Ta \&No Ta Yes -.It Ic ulimit Ta \&No Ta \&No Ta Yes +.It Ic type Ta No** Ta \&No Ta Yes +.It Ic ulimit Ta No** Ta \&No Ta Yes .It Ic umask Ta No** Ta Yes Ta Yes .It Ic unalias Ta No** Ta Yes Ta Yes .It Ic uncomplete Ta \&No Ta Yes Ta \&No Modified: head/usr.bin/alias/Makefile ============================================================================== --- head/usr.bin/alias/Makefile Sun Apr 25 16:43:41 2010 (r207195) +++ head/usr.bin/alias/Makefile Sun Apr 25 17:38:53 2010 (r207196) @@ -10,8 +10,11 @@ LINKS= ${BINDIR}/alias ${BINDIR}/bg \ ${BINDIR}/alias ${BINDIR}/fc \ ${BINDIR}/alias ${BINDIR}/fg \ ${BINDIR}/alias ${BINDIR}/getopts \ + ${BINDIR}/alias ${BINDIR}/hash \ ${BINDIR}/alias ${BINDIR}/jobs \ ${BINDIR}/alias ${BINDIR}/read \ + ${BINDIR}/alias ${BINDIR}/type \ + ${BINDIR}/alias ${BINDIR}/ulimit \ ${BINDIR}/alias ${BINDIR}/umask \ ${BINDIR}/alias ${BINDIR}/unalias \ ${BINDIR}/alias ${BINDIR}/wait From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 19:00:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F37F1065672; Sun, 25 Apr 2010 19:00:37 +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 7F17D8FC0A; Sun, 25 Apr 2010 19:00: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 o3PJ0bBc040925; Sun, 25 Apr 2010 19:00:37 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PJ0ba2040923; Sun, 25 Apr 2010 19:00:37 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201004251900.o3PJ0ba2040923@svn.freebsd.org> From: Michael Tuexen Date: Sun, 25 Apr 2010 19:00: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: r207197 - 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: Sun, 25 Apr 2010 19:00:37 -0000 Author: tuexen Date: Sun Apr 25 19:00:37 2010 New Revision: 207197 URL: http://svn.freebsd.org/changeset/base/207197 Log: Sending a FWDTSN chunk should not affect the retran count. MFC after: 3 days. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Apr 25 17:38:53 2010 (r207196) +++ head/sys/netinet/sctp_output.c Sun Apr 25 19:00:37 2010 (r207197) @@ -8973,7 +8973,7 @@ sctp_chunk_retransmission(struct sctp_in /* (void)SCTP_GETTIME_TIMEVAL(&chk->whoTo->last_sent_time); */ *cnt_out += 1; chk->sent = SCTP_DATAGRAM_SENT; - sctp_ucount_decr(asoc->sent_queue_retran_cnt); + /* sctp_ucount_decr(asoc->sent_queue_retran_cnt); */ if (fwd_tsn == 0) { return (0); } else { From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 19:13:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D87DB1065670; Sun, 25 Apr 2010 19:13:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C78498FC0C; Sun, 25 Apr 2010 19:13: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 o3PJD8Wb044514; Sun, 25 Apr 2010 19:13:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PJD8Fm044512; Sun, 25 Apr 2010 19:13:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004251913.o3PJD8Fm044512@svn.freebsd.org> From: Warner Losh Date: Sun, 25 Apr 2010 19:13:08 +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: r207198 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 19:13:09 -0000 Author: imp Date: Sun Apr 25 19:13:08 2010 New Revision: 207198 URL: http://svn.freebsd.org/changeset/base/207198 Log: MFC r206916 Make sure that we free the passed in data message if we don't actually insert it onto the queue. Also, fix a mtx leak if someone turns off devctl while we're processing a messages. MFC after: 5 days Modified: stable/8/sys/kern/subr_bus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Sun Apr 25 19:00:37 2010 (r207197) +++ stable/8/sys/kern/subr_bus.c Sun Apr 25 19:13:08 2010 (r207198) @@ -545,15 +545,16 @@ devctl_queue_data(char *data) struct proc *p; if (strlen(data) == 0) - return; + goto out; if (devctl_queue_length == 0) - return; + goto out; n1 = malloc(sizeof(*n1), M_BUS, M_NOWAIT); if (n1 == NULL) - return; + goto out; n1->dei_data = data; mtx_lock(&devsoftc.mtx); if (devctl_queue_length == 0) { + mtx_unlock(&devsoftc.mtx); free(n1->dei_data, M_BUS); free(n1, M_BUS); return; @@ -577,6 +578,14 @@ devctl_queue_data(char *data) psignal(p, SIGIO); PROC_UNLOCK(p); } + return; +out: + /* + * We have to free data on all error paths since the caller + * assumes it will be free'd when this item is dequeued. + */ + free(data, M_BUS); + return; } /** From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 19:18:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3E1F106564A; Sun, 25 Apr 2010 19:18:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2E738FC0C; Sun, 25 Apr 2010 19:18: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 o3PJIQ7k046076; Sun, 25 Apr 2010 19:18:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PJIQx0046074; Sun, 25 Apr 2010 19:18:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004251918.o3PJIQx0046074@svn.freebsd.org> From: Warner Losh Date: Sun, 25 Apr 2010 19:18:26 +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: r207199 - stable/7/sys/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Apr 2010 19:18:26 -0000 Author: imp Date: Sun Apr 25 19:18:26 2010 New Revision: 207199 URL: http://svn.freebsd.org/changeset/base/207199 Log: Merge the ARM module building stuff from current (not done as a merge on the makefile becuase there's too many conflicts). Modified: stable/7/sys/modules/Makefile Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Sun Apr 25 19:13:08 2010 (r207198) +++ stable/7/sys/modules/Makefile Sun Apr 25 19:18:26 2010 (r207199) @@ -36,7 +36,7 @@ SUBDIR= ${_3dfx} \ ${_auxio} \ ${_awi} \ axe \ - bce \ + ${_bce} \ bfe \ bge \ ${_bios} \ @@ -68,7 +68,7 @@ SUBDIR= ${_3dfx} \ ${_cs} \ ${_ctau} \ cue \ - cxgb \ + ${_cxgb} \ ${_cx} \ ${_cyclic} \ dc \ @@ -269,7 +269,7 @@ SUBDIR= ${_3dfx} \ ${_stg} \ stge \ ${_streams} \ - sym \ + ${_sym} \ ${_syscons} \ sysvipc \ ti \ @@ -282,7 +282,7 @@ SUBDIR= ${_3dfx} \ txp \ u3g \ uark \ - uart \ + ${_uart} \ ubsa \ ubsec \ ubser \ @@ -341,11 +341,18 @@ SUBDIR= ${_3dfx} \ zlib \ zyd -.if ${MACHINE_ARCH} != "powerpc" +.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "arm" _syscons= syscons _vpo= vpo .endif +.if ${MACHINE_ARCH} != "arm" +_bce= bce +_cxgb= cxgb +_sym= sym +_uart= uart +.endif + .if defined(ALL_MODULES) _ufs= ufs .endif From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 19:21:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 333F9106564A; Sun, 25 Apr 2010 19:21:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 224788FC12; Sun, 25 Apr 2010 19:21: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 o3PJLKla047019; Sun, 25 Apr 2010 19:21:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PJLKDa047017; Sun, 25 Apr 2010 19:21:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004251921.o3PJLKDa047017@svn.freebsd.org> From: Warner Losh Date: Sun, 25 Apr 2010 19:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207200 - stable/8/usr.sbin/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 19:21:20 -0000 Author: imp Date: Sun Apr 25 19:21:19 2010 New Revision: 207200 URL: http://svn.freebsd.org/changeset/base/207200 Log: MFC r206915 Bump minor version of config to reflect the new option remapping feature. The kernel makefiles have specifically not been bumped because nothing uses this new feature and doing so forces everybody to recompile for no good reason. This chnage will be MFC'd where the kernel version numbers for amd64 and ia64 will be bumped, since those are the only two that have use the option remapping feature. Once merged, this will give a better error message to folks that are using buildkernel without buildworld or kernel-toolchain to update their kernels. MFC after: 3 days Modified: stable/8/usr.sbin/config/configvers.h Modified: stable/8/usr.sbin/config/configvers.h ============================================================================== --- stable/8/usr.sbin/config/configvers.h Sun Apr 25 19:18:26 2010 (r207199) +++ stable/8/usr.sbin/config/configvers.h Sun Apr 25 19:21:19 2010 (r207200) @@ -49,5 +49,5 @@ * * $FreeBSD$ */ -#define CONFIGVERS 600007 +#define CONFIGVERS 600008 #define MAJOR_VERS(x) ((x) / 100000) From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 19:22:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE4D9106566C; Sun, 25 Apr 2010 19:22:06 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83CAC8FC13; Sun, 25 Apr 2010 19:22: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 o3PJM62f047286; Sun, 25 Apr 2010 19:22:06 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PJM6dq047284; Sun, 25 Apr 2010 19:22:06 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201004251922.o3PJM6dq047284@svn.freebsd.org> From: Nick Hibma Date: Sun, 25 Apr 2010 19:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207201 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 19:22:06 -0000 Author: n_hibma Date: Sun Apr 25 19:22:06 2010 New Revision: 207201 URL: http://svn.freebsd.org/changeset/base/207201 Log: Remove the call to usbd_reset_device() as this panics the kernel on devices with many serial ports (the device is reset for each port that reports IOERROR). Remove statements that should have been removed when rewriting the if statement. Modified: stable/7/sys/dev/usb/ucom.c Modified: stable/7/sys/dev/usb/ucom.c ============================================================================== --- stable/7/sys/dev/usb/ucom.c Sun Apr 25 19:21:19 2010 (r207200) +++ stable/7/sys/dev/usb/ucom.c Sun Apr 25 19:22:06 2010 (r207201) @@ -689,11 +689,7 @@ ucomwritecb(usbd_xfer_handle xfer, usbd_ printf("%s: ucomwritecb: STALLED; clearing.\n", device_get_nameunit(sc->sc_dev)); usbd_clear_endpoint_stall_async(sc->sc_bulkout_pipe); - } else if (status == USBD_IOERROR) { - printf("%s: ucomwritecb: IOERROR; resetting device.\n", - device_get_nameunit(sc->sc_dev)); - usbd_reset_device(sc->sc_udev); - } else if (status != USBD_CANCELLED) { + } else { printf("%s: ucomwritecb: %s\n", device_get_nameunit(sc->sc_dev), usbd_errstr(status)); @@ -775,19 +771,13 @@ ucomreadcb(usbd_xfer_handle xfer, usbd_p printf("%s: ucomreadcb: %s\n", device_get_nameunit(sc->sc_dev), usbd_errstr(status)); sc->sc_state |= UCS_RXSTOP; - if (status == USBD_STALLED) - usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe); - else if (status == USBD_IOERROR) - usbd_reset_device(sc->sc_udev); if (status == USBD_STALLED) { printf("%s: ucomreadcb: STALLED; clearing.\n", device_get_nameunit(sc->sc_dev)); usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe); - } else if (status == USBD_IOERROR) { - printf("%s: ucomreadcb: IOERROR; resetting device.\n", - device_get_nameunit(sc->sc_dev)); - usbd_reset_device(sc->sc_udev); - } else if (status != USBD_CANCELLED) { + } else if (status == USBD_CANCELLED) { + /* noop */ + } else { printf("%s: ucomreadcb: %s\n", device_get_nameunit(sc->sc_dev), usbd_errstr(status)); From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 20:01:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F32F106566C; Sun, 25 Apr 2010 20:01:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D9F38FC0C; Sun, 25 Apr 2010 20:01: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 o3PK1DL9056362; Sun, 25 Apr 2010 20:01:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PK1Dkh056360; Sun, 25 Apr 2010 20:01:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004252001.o3PK1Dkh056360@svn.freebsd.org> From: Warner Losh Date: Sun, 25 Apr 2010 20:01:13 +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: r207204 - stable/6/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 20:01:13 -0000 Author: imp Date: Sun Apr 25 20:01:13 2010 New Revision: 207204 URL: http://svn.freebsd.org/changeset/base/207204 Log: /boot/loader support doesn't exist for arm in FreeBSD 6.x, so relax the post-install for arm too. Modified: stable/6/sys/conf/kern.post.mk Modified: stable/6/sys/conf/kern.post.mk ============================================================================== --- stable/6/sys/conf/kern.post.mk Sun Apr 25 19:41:25 2010 (r207203) +++ stable/6/sys/conf/kern.post.mk Sun Apr 25 20:01:13 2010 (r207204) @@ -165,7 +165,7 @@ kernel-tags: rm -f tags1 sed -e 's, ../, ,' tags > tags1 -.if ${MACHINE_ARCH} != "ia64" +.if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "arm" .if exists(${DESTDIR}/boot) kernel-install-check: @if [ ! -f ${DESTDIR}/boot/device.hints ] ; then \ From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 20:40:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02DC8106564A; Sun, 25 Apr 2010 20:40:46 +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 E52668FC21; Sun, 25 Apr 2010 20:40: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 o3PKej2j065067; Sun, 25 Apr 2010 20:40:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PKejOe065064; Sun, 25 Apr 2010 20:40:45 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004252040.o3PKejOe065064@svn.freebsd.org> From: Alan Cox Date: Sun, 25 Apr 2010 20:40: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: r207205 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 20:40:46 -0000 Author: alc Date: Sun Apr 25 20:40:45 2010 New Revision: 207205 URL: http://svn.freebsd.org/changeset/base/207205 Log: Clearing a page table entry's accessed bit (PG_A) and setting the page's PG_REFERENCED flag in pmap_protect() can't really be justified. In contrast to pmap_remove() or pmap_remove_all(), the mapping is not being destroyed, so the notion that the page was accessed is not lost. Moreover, clearing the page table entry's accessed bit and setting the page's PG_REFERENCED flag can throw off the page daemon's activity count calculation. Finally, in my tests, I found that 15% of the atomic memory operations being performed by pmap_protect() were only to clear PG_A, and not change protection. This could, by itself, be fixed, but I don't see the point given the above argument. Remove a comment from pmap_protect_pde() that is no longer meaningful after the above change. Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Apr 25 20:01:13 2010 (r207204) +++ head/sys/amd64/amd64/pmap.c Sun Apr 25 20:40:45 2010 (r207205) @@ -2833,18 +2833,9 @@ retry: if (oldpde & PG_MANAGED) { eva = sva + NBPDR; for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); - va < eva; va += PAGE_SIZE, m++) { - /* - * In contrast to the analogous operation on a 4KB page - * mapping, the mapping's PG_A flag is not cleared and - * the page's PG_REFERENCED flag is not set. The - * reason is that pmap_demote_pde() expects that a 2MB - * page mapping with a stored page table page has PG_A - * set. - */ + va < eva; va += PAGE_SIZE, m++) if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); - } } if ((prot & VM_PROT_WRITE) == 0) newpde &= ~(PG_RW | PG_M); @@ -2953,23 +2944,15 @@ retry: obits = pbits = *pte; if ((pbits & PG_V) == 0) continue; - if (pbits & PG_MANAGED) { - m = NULL; - if (pbits & PG_A) { + + if ((prot & VM_PROT_WRITE) == 0) { + if ((pbits & (PG_MANAGED | PG_M | PG_RW)) == + (PG_MANAGED | PG_M | PG_RW)) { m = PHYS_TO_VM_PAGE(pbits & PG_FRAME); - vm_page_flag_set(m, PG_REFERENCED); - pbits &= ~PG_A; - } - if ((pbits & (PG_M | PG_RW)) == (PG_M | PG_RW)) { - if (m == NULL) - m = PHYS_TO_VM_PAGE(pbits & - PG_FRAME); vm_page_dirty(m); } - } - - if ((prot & VM_PROT_WRITE) == 0) pbits &= ~(PG_RW | PG_M); + } if ((prot & VM_PROT_EXECUTE) == 0) pbits |= pg_nx; Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Apr 25 20:01:13 2010 (r207204) +++ head/sys/i386/i386/pmap.c Sun Apr 25 20:40:45 2010 (r207205) @@ -2955,18 +2955,9 @@ retry: if (oldpde & PG_MANAGED) { eva = sva + NBPDR; for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); - va < eva; va += PAGE_SIZE, m++) { - /* - * In contrast to the analogous operation on a 4KB page - * mapping, the mapping's PG_A flag is not cleared and - * the page's PG_REFERENCED flag is not set. The - * reason is that pmap_demote_pde() expects that a 2/4MB - * page mapping with a stored page table page has PG_A - * set. - */ + va < eva; va += PAGE_SIZE, m++) if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); - } } if ((prot & VM_PROT_WRITE) == 0) newpde &= ~(PG_RW | PG_M); @@ -3074,22 +3065,15 @@ retry: obits = pbits = *pte; if ((pbits & PG_V) == 0) continue; - if (pbits & PG_MANAGED) { - m = NULL; - if (pbits & PG_A) { + + if ((prot & VM_PROT_WRITE) == 0) { + if ((pbits & (PG_MANAGED | PG_M | PG_RW)) == + (PG_MANAGED | PG_M | PG_RW)) { m = PHYS_TO_VM_PAGE(pbits & PG_FRAME); - vm_page_flag_set(m, PG_REFERENCED); - pbits &= ~PG_A; - } - if ((pbits & (PG_M | PG_RW)) == (PG_M | PG_RW)) { - if (m == NULL) - m = PHYS_TO_VM_PAGE(pbits & PG_FRAME); vm_page_dirty(m); } - } - - if ((prot & VM_PROT_WRITE) == 0) pbits &= ~(PG_RW | PG_M); + } #ifdef PAE if ((prot & VM_PROT_EXECUTE) == 0) pbits |= pg_nx; From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 20:43:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91AAF1065674; Sun, 25 Apr 2010 20:43:19 +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 673B88FC2A; Sun, 25 Apr 2010 20:43: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 o3PKhJ9U065717; Sun, 25 Apr 2010 20:43:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PKhJi7065713; Sun, 25 Apr 2010 20:43:19 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004252043.o3PKhJi7065713@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 25 Apr 2010 20:43: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: r207206 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 20:43:19 -0000 Author: jilles Date: Sun Apr 25 20:43:19 2010 New Revision: 207206 URL: http://svn.freebsd.org/changeset/base/207206 Log: sh: Use stalloc for arith variable names. This is simpler than the custom memory tracker I added earlier, and is also needed by the dash arith code I plan to import. Modified: head/bin/sh/arith.y head/bin/sh/arith_lex.l head/bin/sh/expand.c Modified: head/bin/sh/arith.y ============================================================================== --- head/bin/sh/arith.y Sun Apr 25 20:40:45 2010 (r207205) +++ head/bin/sh/arith.y Sun Apr 25 20:43:19 2010 (r207206) @@ -287,7 +287,9 @@ arith_t arith(const char *s) { arith_t result; + struct stackmark smark; + setstackmark(&smark); arith_buf = arith_startbuf = s; INTOFF; @@ -295,6 +297,8 @@ arith(const char *s) arith_lex_reset(); /* Reprime lex. */ INTON; + popstackmark(&smark); + return result; } Modified: head/bin/sh/arith_lex.l ============================================================================== --- head/bin/sh/arith_lex.l Sun Apr 25 20:40:45 2010 (r207205) +++ head/bin/sh/arith_lex.l Sun Apr 25 20:43:19 2010 (r207206) @@ -51,13 +51,6 @@ __FBSDID("$FreeBSD$"); int yylex(void); -struct varname -{ - struct varname *next; - char name[1]; -}; -static struct varname *varnames; - #undef YY_INPUT #define YY_INPUT(buf,result,max) \ result = (*buf = *arith_buf++) ? 1 : YY_NULL; @@ -87,14 +80,11 @@ static struct varname *varnames; * If variable doesn't exist, we should initialize * it to zero. */ - struct varname *temp; + char *temp; if (lookupvar(yytext) == NULL) setvarsafe(yytext, "0", 0); - temp = ckmalloc(sizeof(struct varname) + - strlen(yytext)); - temp->next = varnames; - varnames = temp; - yylval.s_value = strcpy(temp->name, yytext); + temp = stalloc(strlen(yytext) + 1); + yylval.s_value = strcpy(temp, yytext); return ARITH_VAR; } @@ -140,15 +130,5 @@ static struct varname *varnames; void arith_lex_reset(void) { - struct varname *name, *next; - YY_NEW_FILE; - - name = varnames; - while (name != NULL) { - next = name->next; - ckfree(name); - name = next; - } - varnames = NULL; } Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Apr 25 20:40:45 2010 (r207205) +++ head/bin/sh/expand.c Sun Apr 25 20:43:19 2010 (r207206) @@ -360,7 +360,7 @@ removerecordregions(int endoff) void expari(int flag) { - char *p, *start; + char *p, *q, *start; arith_t result; int begoff; int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); @@ -398,7 +398,9 @@ expari(int flag) removerecordregions(begoff); if (quotes) rmescapes(p+2); + q = grabstackstr(expdest); result = arith(p+2); + ungrabstackstr(q, expdest); fmtstr(p, DIGITS(result), ARITH_FORMAT_STR, result); while (*p++) ; From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 22:01:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FB141065673; Sun, 25 Apr 2010 22:01:32 +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 8E09F8FC0A; Sun, 25 Apr 2010 22:01: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 o3PM1WMh083623; Sun, 25 Apr 2010 22:01:32 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PM1W8G083621; Sun, 25 Apr 2010 22:01:32 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201004252201.o3PM1W8G083621@svn.freebsd.org> From: Andrew Thompson Date: Sun, 25 Apr 2010 22:01: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: r207207 - head/sys/amd64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2010 22:01:32 -0000 Author: thompsa Date: Sun Apr 25 22:01:32 2010 New Revision: 207207 URL: http://svn.freebsd.org/changeset/base/207207 Log: Set USB_DEBUG like the other platforms, I had turned it off to test the build before committing r207077. Spotted by: marius Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Apr 25 20:43:19 2010 (r207206) +++ head/sys/amd64/conf/GENERIC Sun Apr 25 22:01:32 2010 (r207207) @@ -281,7 +281,7 @@ device firmware # firmware assist modul device bpf # Berkeley packet filter # USB support -#options USB_DEBUG # enable debug msgs +options USB_DEBUG # enable debug msgs device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 23:18:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61BD6106566B; Sun, 25 Apr 2010 23:18:02 +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 4FC9B8FC0C; Sun, 25 Apr 2010 23:18: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 o3PNI2gw000532; Sun, 25 Apr 2010 23:18:02 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PNI2E2000530; Sun, 25 Apr 2010 23:18:02 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004252318.o3PNI2E2000530@svn.freebsd.org> From: Kip Macy Date: Sun, 25 Apr 2010 23:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207210 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Apr 2010 23:18:02 -0000 Author: kmacy Date: Sun Apr 25 23:18:02 2010 New Revision: 207210 URL: http://svn.freebsd.org/changeset/base/207210 Log: Incremental reduction of delta with head_page_lock_2 branch - replace modification of pmap resident_count with pmap_resident_count_{inc,dec} - the pv list is protected by the pmap lock, but in several cases we are relying on the vm page queue mutex, move pv_va read under the pmap lock Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Apr 25 23:08:37 2010 (r207209) +++ head/sys/amd64/amd64/pmap.c Sun Apr 25 23:18:02 2010 (r207210) @@ -404,6 +404,21 @@ pmap_pte(pmap_t pmap, vm_offset_t va) return (pmap_pde_to_pte(pde, va)); } +static __inline void +pmap_resident_count_inc(pmap_t pmap, int count) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + pmap->pm_stats.resident_count += count; +} + +static __inline void +pmap_resident_count_dec(pmap_t pmap, int count) +{ + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + pmap->pm_stats.resident_count -= count; +} PMAP_INLINE pt_entry_t * vtopte(vm_offset_t va) @@ -1477,6 +1492,7 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_of vm_page_t *free) { + PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* * unmap the page table page */ @@ -1496,7 +1512,7 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_of pd = pmap_pde(pmap, va); *pd = 0; } - --pmap->pm_stats.resident_count; + pmap_resident_count_dec(pmap, 1); if (m->pindex < NUPDE) { /* We just released a PT, unhold the matching PD */ vm_page_t pdpg; @@ -1613,6 +1629,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t (flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK, ("_pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK")); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* * Allocate a page table page. */ @@ -1730,7 +1747,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t *pd = VM_PAGE_TO_PHYS(m) | PG_U | PG_RW | PG_V | PG_A | PG_M; } - pmap->pm_stats.resident_count++; + pmap_resident_count_inc(pmap, 1); return (m); } @@ -2037,7 +2054,7 @@ pmap_collect(pmap_t locked_pmap, struct PMAP_LOCK(pmap); else if (pmap != locked_pmap && !PMAP_TRYLOCK(pmap)) continue; - pmap->pm_stats.resident_count--; + pmap_resident_count_dec(pmap, 1); pde = pmap_pde(pmap, va); KASSERT((*pde & PG_PS) == 0, ("pmap_collect: found" " a 2mpage in page %p's pv list", m)); @@ -2438,7 +2455,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t return (FALSE); } if (va < VM_MAXUSER_ADDRESS) - pmap->pm_stats.resident_count++; + pmap_resident_count_inc(pmap, 1); } mptepa = VM_PAGE_TO_PHYS(mpte); firstpte = (pt_entry_t *)PHYS_TO_DMAP(mptepa); @@ -2530,7 +2547,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t */ if (oldpde & PG_G) pmap_invalidate_page(kernel_pmap, sva); - pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE; + pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); if (oldpde & PG_MANAGED) { pvh = pa_to_pvh(oldpde & PG_PS_FRAME); pmap_pvh_free(pvh, pmap, sva); @@ -2553,7 +2570,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t mpte = pmap_lookup_pt_page(pmap, sva); if (mpte != NULL) { pmap_remove_pt_page(pmap, mpte); - pmap->pm_stats.resident_count--; + pmap_resident_count_dec(pmap, 1); KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pde: pte page wire count error")); mpte->wire_count = 0; @@ -2584,7 +2601,7 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t */ if (oldpte & PG_G) pmap_invalidate_page(kernel_pmap, va); - pmap->pm_stats.resident_count -= 1; + pmap_resident_count_dec(pmap, 1); if (oldpte & PG_MANAGED) { m = PHYS_TO_VM_PAGE(oldpte & PG_FRAME); if ((oldpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) @@ -2786,7 +2803,7 @@ pmap_remove_all(vm_page_t m) while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); PMAP_LOCK(pmap); - pmap->pm_stats.resident_count--; + pmap_resident_count_dec(pmap, 1); pde = pmap_pde(pmap, pv->pv_va); KASSERT((*pde & PG_PS) == 0, ("pmap_remove_all: found" " a 2mpage in page %p's pv list", m)); @@ -3192,7 +3209,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, " va: 0x%lx", va)); } } else - pmap->pm_stats.resident_count++; + pmap_resident_count_inc(pmap, 1); /* * Enter on the PV list if part of our managed memory. @@ -3326,7 +3343,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t /* * Increment counters. */ - pmap->pm_stats.resident_count += NBPDR / PAGE_SIZE; + pmap_resident_count_inc(pmap, NBPDR / PAGE_SIZE); /* * Map the superpage. @@ -3480,7 +3497,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ /* * Increment counters */ - pmap->pm_stats.resident_count++; + pmap_resident_count_inc(pmap, 1); pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0); if ((prot & VM_PROT_EXECUTE) == 0) @@ -3585,8 +3602,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs if ((*pde & PG_V) == 0) { pde_store(pde, pa | PG_PS | PG_M | PG_A | PG_U | PG_RW | PG_V); - pmap->pm_stats.resident_count += NBPDR / - PAGE_SIZE; + pmap_resident_count_inc(pmap, NBPDR / PAGE_SIZE); pmap_pde_mappings++; } else { /* Continue on if the PDE is already valid. */ @@ -3653,8 +3669,6 @@ out: PMAP_UNLOCK(pmap); } - - /* * Copy the range specified by src_addr/len * from the source map to the range dst_addr/len @@ -3729,8 +3743,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm pmap_pv_insert_pde(dst_pmap, addr, srcptepaddr & PG_PS_FRAME))) { *pde = srcptepaddr & ~PG_W; - dst_pmap->pm_stats.resident_count += - NBPDR / PAGE_SIZE; + pmap_resident_count_inc(dst_pmap, NBPDR / PAGE_SIZE); } else dstmpde->wire_count--; continue; @@ -3773,7 +3786,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm */ *dst_pte = ptetemp & ~(PG_W | PG_M | PG_A); - dst_pmap->pm_stats.resident_count++; + pmap_resident_count_inc(dst_pmap, 1); } else { free = NULL; if (pmap_unwire_pte_hold(dst_pmap, @@ -4046,7 +4059,7 @@ pmap_remove_pages(pmap_t pmap) pv_entry_count--; pc->pc_map[field] |= bitmask; if ((tpte & PG_PS) != 0) { - pmap->pm_stats.resident_count -= NBPDR / PAGE_SIZE; + pmap_resident_count_dec(pmap, NBPDR / PAGE_SIZE); pvh = pa_to_pvh(tpte & PG_PS_FRAME); TAILQ_REMOVE(&pvh->pv_list, pv, pv_list); if (TAILQ_EMPTY(&pvh->pv_list)) { @@ -4057,7 +4070,7 @@ pmap_remove_pages(pmap_t pmap) mpte = pmap_lookup_pt_page(pmap, pv->pv_va); if (mpte != NULL) { pmap_remove_pt_page(pmap, mpte); - pmap->pm_stats.resident_count--; + pmap_resident_count_dec(pmap, 1); KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pages: pte page wire count error")); mpte->wire_count = 0; @@ -4065,7 +4078,7 @@ pmap_remove_pages(pmap_t pmap) atomic_subtract_int(&cnt.v_wire_count, 1); } } else { - pmap->pm_stats.resident_count--; + pmap_resident_count_dec(pmap, 1); TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); if (TAILQ_EMPTY(&m->md.pv_list)) { pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); @@ -4223,9 +4236,9 @@ pmap_remove_write(vm_page_t m) mtx_assert(&vm_page_queue_mtx, MA_OWNED); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { - va = pv->pv_va; pmap = PV_PMAP(pv); PMAP_LOCK(pmap); + va = pv->pv_va; pde = pmap_pde(pmap, va); if ((*pde & PG_RW) != 0) (void)pmap_demote_pde(pmap, pde, va); @@ -4281,9 +4294,9 @@ pmap_ts_referenced(vm_page_t m) mtx_assert(&vm_page_queue_mtx, MA_OWNED); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, pvn) { - va = pv->pv_va; pmap = PV_PMAP(pv); PMAP_LOCK(pmap); + va = pv->pv_va; pde = pmap_pde(pmap, va); oldpde = *pde; if ((oldpde & PG_A) != 0) { @@ -4353,9 +4366,9 @@ pmap_clear_modify(vm_page_t m) mtx_assert(&vm_page_queue_mtx, MA_OWNED); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { - va = pv->pv_va; pmap = PV_PMAP(pv); PMAP_LOCK(pmap); + va = pv->pv_va; pde = pmap_pde(pmap, va); oldpde = *pde; if ((oldpde & PG_RW) != 0) { @@ -4418,9 +4431,9 @@ pmap_clear_reference(vm_page_t m) mtx_assert(&vm_page_queue_mtx, MA_OWNED); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { - va = pv->pv_va; pmap = PV_PMAP(pv); PMAP_LOCK(pmap); + va = pv->pv_va; pde = pmap_pde(pmap, va); oldpde = *pde; if ((oldpde & PG_A) != 0) { From owner-svn-src-all@FreeBSD.ORG Sun Apr 25 23:51:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F34281065674; Sun, 25 Apr 2010 23:51:05 +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 E29EA8FC15; Sun, 25 Apr 2010 23:51: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 o3PNp54x007895; Sun, 25 Apr 2010 23:51:05 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3PNp5kX007893; Sun, 25 Apr 2010 23:51:05 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004252351.o3PNp5kX007893@svn.freebsd.org> From: Kip Macy Date: Sun, 25 Apr 2010 23:51: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: r207213 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 25 Apr 2010 23:51:06 -0000 Author: kmacy Date: Sun Apr 25 23:51:05 2010 New Revision: 207213 URL: http://svn.freebsd.org/changeset/base/207213 Log: missed pv access before pmap lock Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Apr 25 23:49:32 2010 (r207212) +++ head/sys/amd64/amd64/pmap.c Sun Apr 25 23:51:05 2010 (r207213) @@ -2793,9 +2793,9 @@ pmap_remove_all(vm_page_t m) mtx_assert(&vm_page_queue_mtx, MA_OWNED); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) { - va = pv->pv_va; pmap = PV_PMAP(pv); PMAP_LOCK(pmap); + va = pv->pv_va; pde = pmap_pde(pmap, va); (void)pmap_demote_pde(pmap, pde, va); PMAP_UNLOCK(pmap); From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 11:58:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E004B106566C; Mon, 26 Apr 2010 11:58:15 +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 CF9F68FC18; Mon, 26 Apr 2010 11:58: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 o3QBwFDt075789; Mon, 26 Apr 2010 11:58:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QBwFDA075788; Mon, 26 Apr 2010 11:58:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201004261158.o3QBwFDA075788@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Apr 2010 11:58: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: r207221 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 11:58:16 -0000 Author: mav Date: Mon Apr 26 11:58:15 2010 New Revision: 207221 URL: http://svn.freebsd.org/changeset/base/207221 Log: Mark ATA channel as idle on timeout in non-ATA_CAM mode. This should fix possible duplicate request completion. Submitted by: mjacob Modified: head/sys/dev/ata/ata-queue.c Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Mon Apr 26 04:32:29 2010 (r207220) +++ head/sys/dev/ata/ata-queue.c Mon Apr 26 11:58:15 2010 (r207221) @@ -513,9 +513,9 @@ ata_timeout(struct ata_request *request) request->flags |= ATA_R_TIMEOUT; if (ch->dma.unload) ch->dma.unload(request); -#ifdef ATA_CAM ch->running = NULL; ch->state = ATA_IDLE; +#ifdef ATA_CAM ata_cam_end_transaction(ch->dev, request); #endif mtx_unlock(&ch->state_mtx); From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 12:03:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B490D1065673; Mon, 26 Apr 2010 12:03:55 +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 4F3418FC16; Mon, 26 Apr 2010 12:03:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3QC3tCp077091; Mon, 26 Apr 2010 12:03:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QC3tn3077088; Mon, 26 Apr 2010 12:03:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201004261203.o3QC3tn3077088@svn.freebsd.org> From: Alexander Motin Date: Mon, 26 Apr 2010 12:03: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: r207222 - 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: Mon, 26 Apr 2010 12:03:55 -0000 Author: mav Date: Mon Apr 26 12:03:55 2010 New Revision: 207222 URL: http://svn.freebsd.org/changeset/base/207222 Log: MFp4: Move PI_TAG_ABLE check from ada driver to ATA XPT. Modified: head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Apr 26 11:58:15 2010 (r207221) +++ head/sys/cam/ata/ata_da.c Mon Apr 26 12:03:55 2010 (r207222) @@ -686,14 +686,10 @@ adaregister(struct cam_periph *periph, v else softc->quirks = ADA_Q_NONE; - /* Check if the SIM does not want queued commands */ bzero(&cpi, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); - if (cpi.ccb_h.status != CAM_REQ_CMP || - (cpi.hba_inquiry & PI_TAG_ABLE) == 0) - softc->flags &= ~ADA_FLAG_CAN_NCQ; TASK_INIT(&softc->sysctl_task, 0, adasysctlinit, periph); Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon Apr 26 11:58:15 2010 (r207221) +++ head/sys/cam/ata/ata_xpt.c Mon Apr 26 12:03:55 2010 (r207222) @@ -766,6 +766,7 @@ noerror: } case PROBE_IDENTIFY: { + struct ccb_pathinq cpi; int16_t *ptr; ident_buf = &softc->ident_data; @@ -840,16 +841,24 @@ noerror: ata_find_quirk(path->device); if (path->device->mintags != 0 && path->bus->sim->max_tagged_dev_openings != 0) { - /* Report SIM which tags are allowed. */ - bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); - cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; - cts.type = CTS_TYPE_CURRENT_SETTINGS; - cts.xport_specific.sata.tags = path->device->maxtags; - cts.xport_specific.sata.valid = CTS_SATA_VALID_TAGS; - xpt_action((union ccb *)&cts); - /* Reconfigure queues for tagged queueing. */ - xpt_start_tags(path); + /* Check if the SIM does not want queued commands. */ + bzero(&cpi, sizeof(cpi)); + xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); + cpi.ccb_h.func_code = XPT_PATH_INQ; + xpt_action((union ccb *)&cpi); + if (cpi.ccb_h.status == CAM_REQ_CMP && + (cpi.hba_inquiry & PI_TAG_ABLE)) { + /* Report SIM which tags are allowed. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); + cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + cts.xport_specific.sata.tags = path->device->maxtags; + cts.xport_specific.sata.valid = CTS_SATA_VALID_TAGS; + xpt_action((union ccb *)&cts); + /* Reconfigure queues for tagged queueing. */ + xpt_start_tags(path); + } } ata_device_transport(path); PROBE_SET_ACTION(softc, PROBE_SETMODE); From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 13:48:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DC52106566B; Mon, 26 Apr 2010 13:48:23 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B26D8FC14; Mon, 26 Apr 2010 13:48: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 o3QDmNtl000253; Mon, 26 Apr 2010 13:48:23 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QDmN3H000249; Mon, 26 Apr 2010 13:48:23 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201004261348.o3QDmN3H000249@svn.freebsd.org> From: Lawrence Stewart Date: Mon, 26 Apr 2010 13:48: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: r207223 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 13:48:23 -0000 Author: lstewart Date: Mon Apr 26 13:48:22 2010 New Revision: 207223 URL: http://svn.freebsd.org/changeset/base/207223 Log: - Rework the underlying ALQ storage to be a circular buffer, which amongst other things allows variable length messages to be easily supported. - Extend KPI with alq_writen() and alq_getn() to support variable length messages, which is enabled at ALQ creation time depending on the arguments passed to alq_open(). Also add variants of alq_open() and alq_post() that accept a flags argument. The KPI is still fully backwards compatible and shouldn't require any change in ALQ consumers unless they wish to utilise the new features. - Introduce the ALQ_NOACTIVATE and ALQ_ORDERED flags to allow ALQ consumers to have more control over IO scheduling and resource acquisition respectively. - Strengthen invariants checking. - Document ALQ changes in ALQ(9) man page. Sponsored by: FreeBSD Foundation Reviewed by: gnn, jeff, rpaulo, rwatson MFC after: 1 month Modified: head/share/man/man9/alq.9 head/sys/kern/kern_alq.c head/sys/sys/alq.h Modified: head/share/man/man9/alq.9 ============================================================================== --- head/share/man/man9/alq.9 Mon Apr 26 12:03:55 2010 (r207222) +++ head/share/man/man9/alq.9 Mon Apr 26 13:48:22 2010 (r207223) @@ -1,7 +1,13 @@ .\" .\" Copyright (c) 2003 Hiten Pandya +.\" Copyright (c) 2009-2010 The FreeBSD Foundation .\" All rights reserved. .\" +.\" Portions of this software were developed at the Centre for Advanced +.\" Internet Architectures, Swinburne University of Technology, Melbourne, +.\" Australia by Lawrence Stewart under sponsorship from the FreeBSD +.\" Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -25,21 +31,34 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2003 +.Dd April 26, 2010 .Dt ALQ 9 .Os .Sh NAME .Nm alq , +.Nm alq_open_flags , .Nm alq_open , +.Nm alq_writen , .Nm alq_write , .Nm alq_flush , .Nm alq_close , +.Nm alq_getn , .Nm alq_get , +.Nm alq_post_flags , .Nm alq_post .Nd Asynchronous Logging Queues .Sh SYNOPSIS .In sys/alq.h .Ft int +.Fo alq_open_flags +.Fa "struct alq **app" +.Fa "const char *file" +.Fa "struct ucred *cred" +.Fa "int cmode" +.Fa "int size" +.Fa "int flags" +.Fc +.Ft int .Fo alq_open .Fa "struct alq **app" .Fa "const char *file" @@ -49,19 +68,25 @@ .Fa "int count" .Fc .Ft int -.Fn alq_write "struct alq *alq" "void *data" "int waitok" +.Fn alq_writen "struct alq *alq" "void *data" "int len" "int flags" +.Ft int +.Fn alq_write "struct alq *alq" "void *data" "int flags" .Ft void .Fn alq_flush "struct alq *alq" .Ft void .Fn alq_close "struct alq *alq" .Ft struct ale * -.Fn alq_get "struct alq *alq" "int waitok" +.Fn alq_getn "struct alq *alq" "int len" "int flags" +.Ft struct ale * +.Fn alq_get "struct alq *alq" "int flags" +.Ft void +.Fn alq_post_flags "struct alq *alq" "struct ale *ale" "int flags" .Ft void .Fn alq_post "struct alq *alq" "struct ale *ale" .Sh DESCRIPTION The .Nm -facility provides an asynchronous fixed length recording +facility provides an asynchronous fixed or variable length recording mechanism, known as Asynchronous Logging Queues. It can record to any .Xr vnode 9 , @@ -81,26 +106,37 @@ is defined as which has the following members: .Bd -literal -offset indent struct ale { - struct ale *ae_next; /* Next Entry */ - char *ae_data; /* Entry buffer */ - int ae_flags; /* Entry flags */ + intptr_t ae_bytesused; /* # bytes written to ALE. */ + char *ae_data; /* Write ptr. */ + int ae_pad; /* Unused, compat. */ }; .Ed .Pp -The -.Va ae_flags -field is for internal use, clients of the +An .Nm -interface should not modify this field. -Behaviour is undefined if this field is modified. +can be created in either fixed or variable length mode. +A variable length +.Nm +accommodates writes of varying length using +.Fn alq_writen +and +.Fn alq_getn . +A fixed length +.Nm +accommodates a fixed number of writes using +.Fn alq_write +and +.Fn alq_get , +each of fixed size (set at queue creation time). +Fixed length mode is deprecated in favour of variable length mode. .Sh FUNCTIONS The -.Fn alq_open -function creates a new logging queue. +.Fn alq_open_flags +function creates a new variable length asynchronous logging queue. The .Fa file -argument is the name of the file to open for logging; if the file does not -yet exist, +argument is the name of the file to open for logging. +If the file does not yet exist, .Fn alq_open will attempt to create it. The @@ -112,33 +148,99 @@ as the requested creation mode, to be us Consumers of this API may wish to pass .Dv ALQ_DEFAULT_CMODE , a default creation mode suitable for most applications. -The argument +The .Fa cred -specifies the credentials to use when opening and performing I/O on the file. -The size of each entry in the queue is determined by -.Fa size . +argument specifies the credentials to use when opening and performing I/O on the file. The +.Fa size +argument sets the size (in bytes) of the underlying queue. +The ALQ_ORDERED flag may be passed in via +.Fa flags +to indicate that the ordering of writer threads waiting for a busy +.Nm +to free up resources should be preserved. +.Pp +The deprecated +.Fn alq_open +function is implemented as a wrapper around +.Fn alq_open_flags +to provide backwards compatibility to consumers that have not been updated to +utilise the newer +.Fn alq_open_flags +function. +It passes all arguments through to +.Fn alq_open_flags +untouched except for +.Fa size +and +.Fa count , +and sets +.Fa flags +to 0. +To create a variable length mode +.Nm , +the +.Fa size +argument should be set to the size (in bytes) of the underlying queue and the +.Fa count +argument should be set to 0. +To create a fixed length mode +.Nm , +the +.Fa size +argument should be set to the size (in bytes) of each write and the .Fa count -argument determines the number of items to be stored in the -asynchronous queue over an approximate period of a disk -write operation. +argument should be set to the number of +.Fa size +byte chunks to reserve capacity for. .Pp The -.Fn alq_write +.Fn alq_writen function writes +.Fa len +bytes from .Fa data -to the designated queue, +to the designated variable length mode queue .Fa alq . -In the event that -.Fn alq_write -could not write the entry immediately, and +If +.Fn alq_writen +could not write the entry immediately and .Dv ALQ_WAITOK -is passed to -.Fa waitok , -then +is set in +.Fa flags , +the function will be allowed to +.Xr msleep_spin 9 +with the +.Dq Li alqwnord +or +.Dq Li alqwnres +wait message. +A write will automatically schedule the queue +.Fa alq +to be flushed to disk. +This behaviour can be controlled by passing ALQ_NOACTIVATE via +.Fa flags +to indicate that the write should not schedule +.Fa alq +to be flushed to disk. +.Pp +The deprecated +.Fn alq_write +function is implemented as a wrapper around +.Fn alq_writen +to provide backwards compatibility to consumers that have not been updated to +utilise variable length mode queues. +The function will write +.Fa size +bytes of data (where +.Fa size +was specified at queue creation time) from the +.Fa data +buffer to the +.Fa alq . +Note that it is an error to call .Fn alq_write -will be allowed to -.Xr tsleep 9 . +on a variable length mode queue. .Pp The .Fn alq_flush @@ -146,61 +248,136 @@ function is used for flushing .Fa alq to the log medium that was passed to .Fn alq_open . +If +.Fa alq +has data to flush and is not already in the process of being flushed, the +function will block doing IO. +Otherwise, the function will return immediately. .Pp The .Fn alq_close -function will close the asynchronous logging queue, -.Fa alq , +function will close the asynchronous logging queue +.Fa alq and flush all pending write requests to the log medium. It will free all resources that were previously allocated. .Pp The -.Fn alq_get -function returns the next available asynchronous logging entry -from the queue, -.Fa alq . -This function leaves the queue in a locked state, until a subsequent +.Fn alq_getn +function returns an asynchronous log entry from +.Fa alq , +initialised to point at a buffer capable of receiving +.Fa len +bytes of data. +This function leaves +.Fa alq +in a locked state, until a subsequent .Fn alq_post +or +.Fn alq_post_flags call is made. -In the event that -.Fn alq_get -could not retrieve an entry immediately, it will -.Xr tsleep 9 +If +.Fn alq_getn +could not obtain +.Fa len +bytes of buffer immediately and +.Dv ALQ_WAITOK +is set in +.Fa flags , +the function will be allowed to +.Xr msleep_spin 9 with the -.Dq Li alqget +.Dq Li alqgnord +or +.Dq Li alqgnres wait message. +The caller can choose to write less than +.Fa len +bytes of data to the returned asynchronous log entry by setting the entry's +ae_bytesused field to the number of bytes actually written. +This must be done prior to calling +.Fn alq_post . .Pp -The -.Fn alq_post -function schedules the asynchronous logging entry, -.Fa ale , -which is retrieved using the +The deprecated .Fn alq_get -function, -for writing to the asynchronous logging queue, +function is implemented as a wrapper around +.Fn alq_getn +to provide backwards compatibility to consumers that have not been updated to +utilise variable length mode queues. +The asynchronous log entry returned will be initialised to point at a buffer +capable of receiving +.Fa size +bytes of data (where +.Fa size +was specified at queue creation time). +Note that it is an error to call +.Fn alq_get +on a variable length mode queue. +.Pp +The +.Fn alq_post_flags +function schedules the asynchronous log entry +.Fa ale +(obtained from +.Fn alq_getn +or +.Fn alq_get ) +for writing to .Fa alq . -This function leaves the queue, -.Fa alq , +The ALQ_NOACTIVATE flag may be passed in via +.Fa flags +to indicate that the queue should not be immediately scheduled to be flushed to +disk. +This function leaves +.Fa alq in an unlocked state. +.Pp +The +.Fn alq_post +function is implemented as a wrapper around +.Fn alq_post_flags +to provide backwards compatibility to consumers that have not been updated to +utilise the newer +.Fn alq_post_flags +function. +It simply passes all arguments through to +.Fn alq_post_flags +untouched, and sets +.Fa flags +to 0. .Sh IMPLEMENTATION NOTES The +.Fn alq_writen +and .Fn alq_write -function is a wrapper around the +functions both perform a +.Xr bcopy 3 +from the supplied +.Fa data +buffer into the underlying +.Nm +buffer. +Performance critical code paths may wish to consider using +.Fn alq_getn +(variable length queues) or +.Fn alq_get +(fixed length queues) to avoid the extra memory copy. Note that a queue +remains locked between calls to +.Fn alq_getn +or .Fn alq_get and .Fn alq_post -functions; by using these functions separately, a call -to -.Fn bcopy -can be avoided for performance critical code paths. +or +.Fn alq_post_flags , +so this method of writing to a queue is unsuitable for situations where the +time between calls may be substantial. .Sh LOCKING -Each asynchronous queue is protected by a spin mutex. +Each asynchronous logging queue is protected by a spin mutex. .Pp Functions -.Fn alq_flush , -.Fn alq_open +.Fn alq_flush and -.Fn alq_post +.Fn alq_open may attempt to acquire an internal sleep mutex, and should consequently not be used in contexts where sleeping is not allowed. @@ -214,32 +391,36 @@ if it fails to open or else it returns 0. .Pp The +.Fn alq_writen +and .Fn alq_write -function returns +functions return .Er EWOULDBLOCK if .Dv ALQ_NOWAIT -was provided as a value to -.Fa waitok -and either the queue is full, or when the system is shutting down. +was set in +.Fa flags +and either the queue is full or the system is shutting down. .Pp The +.Fn alq_getn +and .Fn alq_get -function returns -.Dv NULL , +functions return +.Dv NULL if .Dv ALQ_NOWAIT -was provided as a value to -.Fa waitok -and either the queue is full, or when the system is shutting down. +was set in +.Fa flags +and either the queue is full or the system is shutting down. .Pp NOTE: invalid arguments to non-void functions will result in undefined behaviour. .Sh SEE ALSO -.Xr syslog 3 , -.Xr kthread 9 , +.Xr kproc 9 , .Xr ktr 9 , -.Xr tsleep 9 , +.Xr msleep_spin 9 , +.Xr syslog 3 , .Xr vnode 9 .Sh HISTORY The @@ -250,7 +431,11 @@ Asynchronous Logging Queues (ALQ) facili The .Nm facility was written by -.An Jeffrey Roberson Aq jeff@FreeBSD.org . +.An Jeffrey Roberson Aq jeff@FreeBSD.org +and extended by +.An Lawrence Stewart Aq lstewart@freebsd.org . .Pp This manual page was written by -.An Hiten Pandya Aq hmp@FreeBSD.org . +.An Hiten Pandya Aq hmp@FreeBSD.org +and revised by +.An Lawrence Stewart Aq lstewart@freebsd.org . Modified: head/sys/kern/kern_alq.c ============================================================================== --- head/sys/kern/kern_alq.c Mon Apr 26 12:03:55 2010 (r207222) +++ head/sys/kern/kern_alq.c Mon Apr 26 13:48:22 2010 (r207223) @@ -55,16 +55,23 @@ __FBSDID("$FreeBSD$"); /* Async. Logging Queue */ struct alq { + char *aq_entbuf; /* Buffer for stored entries */ int aq_entmax; /* Max entries */ int aq_entlen; /* Entry length */ - char *aq_entbuf; /* Buffer for stored entries */ + int aq_freebytes; /* Bytes available in buffer */ + int aq_buflen; /* Total length of our buffer */ + int aq_writehead; /* Location for next write */ + int aq_writetail; /* Flush starts at this location */ + int aq_wrapearly; /* # bytes left blank at end of buf */ int aq_flags; /* Queue flags */ + int aq_waiters; /* Num threads waiting for resources + * NB: Used as a wait channel so must + * not be first field in the alq struct + */ + struct ale aq_getpost; /* ALE for use by get/post */ struct mtx aq_mtx; /* Queue lock */ struct vnode *aq_vp; /* Open vnode handle */ struct ucred *aq_cred; /* Credentials of the opening thread */ - struct ale *aq_first; /* First ent */ - struct ale *aq_entfree; /* First free ent */ - struct ale *aq_entvalid; /* First ent valid for writing */ LIST_ENTRY(alq) aq_act; /* List of active queues */ LIST_ENTRY(alq) aq_link; /* List of all queues */ }; @@ -73,10 +80,14 @@ struct alq { #define AQ_ACTIVE 0x0002 /* on the active list */ #define AQ_FLUSHING 0x0004 /* doing IO */ #define AQ_SHUTDOWN 0x0008 /* Queue no longer valid */ +#define AQ_ORDERED 0x0010 /* Queue enforces ordered writes */ +#define AQ_LEGACY 0x0020 /* Legacy queue (fixed length writes) */ #define ALQ_LOCK(alq) mtx_lock_spin(&(alq)->aq_mtx) #define ALQ_UNLOCK(alq) mtx_unlock_spin(&(alq)->aq_mtx) +#define HAS_PENDING_DATA(alq) ((alq)->aq_freebytes != (alq)->aq_buflen) + static MALLOC_DEFINE(M_ALD, "ALD", "ALD"); /* @@ -205,7 +216,7 @@ ald_daemon(void) needwakeup = alq_doio(alq); ALQ_UNLOCK(alq); if (needwakeup) - wakeup(alq); + wakeup_one(alq); ALD_LOCK(); } @@ -252,6 +263,20 @@ alq_shutdown(struct alq *alq) /* Stop any new writers. */ alq->aq_flags |= AQ_SHUTDOWN; + /* + * If the ALQ isn't active but has unwritten data (possible if + * the ALQ_NOACTIVATE flag has been used), explicitly activate the + * ALQ here so that the pending data gets flushed by the ald_daemon. + */ + if (!(alq->aq_flags & AQ_ACTIVE) && HAS_PENDING_DATA(alq)) { + alq->aq_flags |= AQ_ACTIVE; + ALQ_UNLOCK(alq); + ALD_LOCK(); + ald_activate(alq); + ALD_UNLOCK(); + ALQ_LOCK(alq); + } + /* Drain IO */ while (alq->aq_flags & AQ_ACTIVE) { alq->aq_flags |= AQ_WANTED; @@ -271,7 +296,6 @@ alq_destroy(struct alq *alq) alq_shutdown(alq); mtx_destroy(&alq->aq_mtx); - free(alq->aq_first, M_ALD); free(alq->aq_entbuf, M_ALD); free(alq, M_ALD); } @@ -287,46 +311,54 @@ alq_doio(struct alq *alq) struct vnode *vp; struct uio auio; struct iovec aiov[2]; - struct ale *ale; - struct ale *alstart; int totlen; int iov; int vfslocked; + int wrapearly; + + KASSERT((HAS_PENDING_DATA(alq)), ("%s: queue empty!", __func__)); vp = alq->aq_vp; td = curthread; totlen = 0; - iov = 0; - - alstart = ale = alq->aq_entvalid; - alq->aq_entvalid = NULL; + iov = 1; + wrapearly = alq->aq_wrapearly; bzero(&aiov, sizeof(aiov)); bzero(&auio, sizeof(auio)); - do { - if (aiov[iov].iov_base == NULL) - aiov[iov].iov_base = ale->ae_data; - aiov[iov].iov_len += alq->aq_entlen; - totlen += alq->aq_entlen; - /* Check to see if we're wrapping the buffer */ - if (ale->ae_data + alq->aq_entlen != ale->ae_next->ae_data) - iov++; - ale->ae_flags &= ~AE_VALID; - ale = ale->ae_next; - } while (ale->ae_flags & AE_VALID); + /* Start the write from the location of our buffer tail pointer. */ + aiov[0].iov_base = alq->aq_entbuf + alq->aq_writetail; + + if (alq->aq_writetail < alq->aq_writehead) { + /* Buffer not wrapped. */ + totlen = aiov[0].iov_len = alq->aq_writehead - alq->aq_writetail; + } else if (alq->aq_writehead == 0) { + /* Buffer not wrapped (special case to avoid an empty iov). */ + totlen = aiov[0].iov_len = alq->aq_buflen - alq->aq_writetail - + wrapearly; + } else { + /* + * Buffer wrapped, requires 2 aiov entries: + * - first is from writetail to end of buffer + * - second is from start of buffer to writehead + */ + aiov[0].iov_len = alq->aq_buflen - alq->aq_writetail - + wrapearly; + iov++; + aiov[1].iov_base = alq->aq_entbuf; + aiov[1].iov_len = alq->aq_writehead; + totlen = aiov[0].iov_len + aiov[1].iov_len; + } alq->aq_flags |= AQ_FLUSHING; ALQ_UNLOCK(alq); - if (iov == 2 || aiov[iov].iov_base == NULL) - iov--; - auio.uio_iov = &aiov[0]; auio.uio_offset = 0; auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; - auio.uio_iovcnt = iov + 1; + auio.uio_iovcnt = iov; auio.uio_resid = totlen; auio.uio_td = td; @@ -350,8 +382,28 @@ alq_doio(struct alq *alq) ALQ_LOCK(alq); alq->aq_flags &= ~AQ_FLUSHING; - if (alq->aq_entfree == NULL) - alq->aq_entfree = alstart; + /* Adjust writetail as required, taking into account wrapping. */ + alq->aq_writetail = (alq->aq_writetail + totlen + wrapearly) % + alq->aq_buflen; + alq->aq_freebytes += totlen + wrapearly; + + /* + * If we just flushed part of the buffer which wrapped, reset the + * wrapearly indicator. + */ + if (wrapearly) + alq->aq_wrapearly = 0; + + /* + * If we just flushed the buffer completely, reset indexes to 0 to + * minimise buffer wraps. + * This is also required to ensure alq_getn() can't wedge itself. + */ + if (!HAS_PENDING_DATA(alq)) + alq->aq_writehead = alq->aq_writetail = 0; + + KASSERT((alq->aq_writetail >= 0 && alq->aq_writetail < alq->aq_buflen), + ("%s: aq_writetail < 0 || aq_writetail >= aq_buflen", __func__)); if (alq->aq_flags & AQ_WANTED) { alq->aq_flags &= ~AQ_WANTED; @@ -376,27 +428,27 @@ SYSINIT(ald, SI_SUB_LOCK, SI_ORDER_ANY, /* * Create the queue data structure, allocate the buffer, and open the file. */ + int -alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode, - int size, int count) +alq_open_flags(struct alq **alqp, const char *file, struct ucred *cred, int cmode, + int size, int flags) { struct thread *td; struct nameidata nd; - struct ale *ale; - struct ale *alp; struct alq *alq; - char *bufp; - int flags; + int oflags; int error; - int i, vfslocked; + int vfslocked; + + KASSERT((size > 0), ("%s: size <= 0", __func__)); *alqp = NULL; td = curthread; NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, file, td); - flags = FWRITE | O_NOFOLLOW | O_CREAT; + oflags = FWRITE | O_NOFOLLOW | O_CREAT; - error = vn_open_cred(&nd, &flags, cmode, 0, cred, NULL); + error = vn_open_cred(&nd, &oflags, cmode, 0, cred, NULL); if (error) return (error); @@ -407,31 +459,20 @@ alq_open(struct alq **alqp, const char * VFS_UNLOCK_GIANT(vfslocked); alq = malloc(sizeof(*alq), M_ALD, M_WAITOK|M_ZERO); - alq->aq_entbuf = malloc(count * size, M_ALD, M_WAITOK|M_ZERO); - alq->aq_first = malloc(sizeof(*ale) * count, M_ALD, M_WAITOK|M_ZERO); alq->aq_vp = nd.ni_vp; alq->aq_cred = crhold(cred); - alq->aq_entmax = count; - alq->aq_entlen = size; - alq->aq_entfree = alq->aq_first; mtx_init(&alq->aq_mtx, "ALD Queue", NULL, MTX_SPIN|MTX_QUIET); - bufp = alq->aq_entbuf; - ale = alq->aq_first; - alp = NULL; - - /* Match up entries with buffers */ - for (i = 0; i < count; i++) { - if (alp) - alp->ae_next = ale; - ale->ae_data = bufp; - alp = ale; - ale++; - bufp += size; - } - - alp->ae_next = alq->aq_first; + alq->aq_buflen = size; + alq->aq_entmax = 0; + alq->aq_entlen = 0; + + alq->aq_freebytes = alq->aq_buflen; + alq->aq_entbuf = malloc(alq->aq_buflen, M_ALD, M_WAITOK|M_ZERO); + alq->aq_writehead = alq->aq_writetail = 0; + if (flags & ALQ_ORDERED) + alq->aq_flags |= AQ_ORDERED; if ((error = ald_add(alq)) != 0) { alq_destroy(alq); @@ -443,77 +484,405 @@ alq_open(struct alq **alqp, const char * return (0); } +int +alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode, + int size, int count) +{ + int ret; + + KASSERT((count >= 0), ("%s: count < 0", __func__)); + + if (count > 0) { + ret = alq_open_flags(alqp, file, cred, cmode, size*count, 0); + (*alqp)->aq_flags |= AQ_LEGACY; + (*alqp)->aq_entmax = count; + (*alqp)->aq_entlen = size; + } else + ret = alq_open_flags(alqp, file, cred, cmode, size, 0); + + return (ret); +} + + /* * Copy a new entry into the queue. If the operation would block either * wait or return an error depending on the value of waitok. */ int -alq_write(struct alq *alq, void *data, int waitok) +alq_writen(struct alq *alq, void *data, int len, int flags) { - struct ale *ale; + int activate, copy, ret; + void *waitchan; + + KASSERT((len > 0 && len <= alq->aq_buflen), + ("%s: len <= 0 || len > aq_buflen", __func__)); - if ((ale = alq_get(alq, waitok)) == NULL) + activate = ret = 0; + copy = len; + waitchan = NULL; + + ALQ_LOCK(alq); + + /* + * Fail to perform the write and return EWOULDBLOCK if: + * - The message is larger than our underlying buffer. + * - The ALQ is being shutdown. + * - There is insufficient free space in our underlying buffer + * to accept the message and the user can't wait for space. + * - There is insufficient free space in our underlying buffer + * to accept the message and the alq is inactive due to prior + * use of the ALQ_NOACTIVATE flag (which would lead to deadlock). + */ + if (len > alq->aq_buflen || + alq->aq_flags & AQ_SHUTDOWN || + (((flags & ALQ_NOWAIT) || (!(alq->aq_flags & AQ_ACTIVE) && + HAS_PENDING_DATA(alq))) && alq->aq_freebytes < len)) { + ALQ_UNLOCK(alq); return (EWOULDBLOCK); + } - bcopy(data, ale->ae_data, alq->aq_entlen); - alq_post(alq, ale); + /* + * If we want ordered writes and there is already at least one thread + * waiting for resources to become available, sleep until we're woken. + */ + if (alq->aq_flags & AQ_ORDERED && alq->aq_waiters > 0) { + KASSERT(!(flags & ALQ_NOWAIT), + ("%s: ALQ_NOWAIT set but incorrectly ignored!", __func__)); + alq->aq_waiters++; + msleep_spin(&alq->aq_waiters, &alq->aq_mtx, "alqwnord", 0); + alq->aq_waiters--; + } - return (0); + /* + * (ALQ_WAITOK && aq_freebytes < len) or aq_freebytes >= len, either + * enter while loop and sleep until we have enough free bytes (former) + * or skip (latter). If AQ_ORDERED is set, only 1 thread at a time will + * be in this loop. Otherwise, multiple threads may be sleeping here + * competing for ALQ resources. + */ + while (alq->aq_freebytes < len && !(alq->aq_flags & AQ_SHUTDOWN)) { + KASSERT(!(flags & ALQ_NOWAIT), + ("%s: ALQ_NOWAIT set but incorrectly ignored!", __func__)); + alq->aq_flags |= AQ_WANTED; + alq->aq_waiters++; + if (waitchan) + wakeup(waitchan); + msleep_spin(alq, &alq->aq_mtx, "alqwnres", 0); + alq->aq_waiters--; + + /* + * If we're the first thread to wake after an AQ_WANTED wakeup + * but there isn't enough free space for us, we're going to loop + * and sleep again. If there are other threads waiting in this + * loop, schedule a wakeup so that they can see if the space + * they require is available. + */ + if (alq->aq_waiters > 0 && !(alq->aq_flags & AQ_ORDERED) && + alq->aq_freebytes < len && !(alq->aq_flags & AQ_WANTED)) + waitchan = alq; + else + waitchan = NULL; + } + + /* + * If there are waiters, we need to signal the waiting threads after we + * complete our work. The alq ptr is used as a wait channel for threads + * requiring resources to be freed up. In the AQ_ORDERED case, threads + * are not allowed to concurrently compete for resources in the above + * while loop, so we use a different wait channel in this case. + */ + if (alq->aq_waiters > 0) { + if (alq->aq_flags & AQ_ORDERED) + waitchan = &alq->aq_waiters; + else + waitchan = alq; + } else + waitchan = NULL; + + /* Bail if we're shutting down. */ + if (alq->aq_flags & AQ_SHUTDOWN) { + ret = EWOULDBLOCK; + goto unlock; + } + + /* + * If we need to wrap the buffer to accommodate the write, + * we'll need 2 calls to bcopy. + */ + if ((alq->aq_buflen - alq->aq_writehead) < len) + copy = alq->aq_buflen - alq->aq_writehead; + + /* Copy message (or part thereof if wrap required) to the buffer. */ + bcopy(data, alq->aq_entbuf + alq->aq_writehead, copy); + alq->aq_writehead += copy; + + if (alq->aq_writehead >= alq->aq_buflen) { + KASSERT((alq->aq_writehead == alq->aq_buflen), + ("%s: alq->aq_writehead (%d) > alq->aq_buflen (%d)", + __func__, + alq->aq_writehead, + alq->aq_buflen)); + alq->aq_writehead = 0; + } + + if (copy != len) { + /* + * Wrap the buffer by copying the remainder of our message + * to the start of the buffer and resetting aq_writehead. + */ + bcopy(((uint8_t *)data)+copy, alq->aq_entbuf, len - copy); + alq->aq_writehead = len - copy; + } + + KASSERT((alq->aq_writehead >= 0 && alq->aq_writehead < alq->aq_buflen), + ("%s: aq_writehead < 0 || aq_writehead >= aq_buflen", __func__)); + + alq->aq_freebytes -= len; + + if (!(alq->aq_flags & AQ_ACTIVE) && !(flags & ALQ_NOACTIVATE)) { + alq->aq_flags |= AQ_ACTIVE; + activate = 1; + } + + KASSERT((HAS_PENDING_DATA(alq)), ("%s: queue empty!", __func__)); + +unlock: + ALQ_UNLOCK(alq); + + if (activate) { + ALD_LOCK(); + ald_activate(alq); + ALD_UNLOCK(); + } + + /* NB: We rely on wakeup_one waking threads in a FIFO manner. */ + if (waitchan != NULL) + wakeup_one(waitchan); + + return (ret); +} + +int +alq_write(struct alq *alq, void *data, int flags) +{ + /* Should only be called in fixed length message (legacy) mode. */ + KASSERT((alq->aq_flags & AQ_LEGACY), + ("%s: fixed length write on variable length queue", __func__)); + return (alq_writen(alq, data, alq->aq_entlen, flags)); } +/* + * Retrieve a pointer for the ALQ to write directly into, avoiding bcopy. + */ struct ale * -alq_get(struct alq *alq, int waitok) +alq_getn(struct alq *alq, int len, int flags) { - struct ale *ale; - struct ale *aln; + int contigbytes; + void *waitchan; + + KASSERT((len > 0 && len <= alq->aq_buflen), + ("%s: len <= 0 || len > alq->aq_buflen", __func__)); - ale = NULL; + waitchan = NULL; ALQ_LOCK(alq); - /* Loop until we get an entry or we're shutting down */ - while ((alq->aq_flags & AQ_SHUTDOWN) == 0 && - (ale = alq->aq_entfree) == NULL && - (waitok & ALQ_WAITOK)) { + /* + * Determine the number of free contiguous bytes. + * We ensure elsewhere that if aq_writehead == aq_writetail because + * the buffer is empty, they will both be set to 0 and therefore + * aq_freebytes == aq_buflen and is fully contiguous. + * If they are equal and the buffer is not empty, aq_freebytes will + * be 0 indicating the buffer is full. + */ + if (alq->aq_writehead <= alq->aq_writetail) + contigbytes = alq->aq_freebytes; + else { + contigbytes = alq->aq_buflen - alq->aq_writehead; + + if (contigbytes < len) { + /* + * Insufficient space at end of buffer to handle a + * contiguous write. Wrap early if there's space at + * the beginning. This will leave a hole at the end + * of the buffer which we will have to skip over when + * flushing the buffer to disk. + */ + if (alq->aq_writetail >= len || flags & ALQ_WAITOK) { + /* Keep track of # bytes left blank. */ + alq->aq_wrapearly = contigbytes; + /* Do the wrap and adjust counters. */ + contigbytes = alq->aq_freebytes = + alq->aq_writetail; + alq->aq_writehead = 0; + } + } + } + + /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 15:01:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22E301065672; Mon, 26 Apr 2010 15:01:15 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11FD18FC1C; Mon, 26 Apr 2010 15:01: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 o3QF1EbE016843; Mon, 26 Apr 2010 15:01:14 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QF1EJr016841; Mon, 26 Apr 2010 15:01:14 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004261501.o3QF1EJr016841@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 26 Apr 2010 15:01: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: r207224 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 15:01:15 -0000 Author: ume Date: Mon Apr 26 15:01:14 2010 New Revision: 207224 URL: http://svn.freebsd.org/changeset/base/207224 Log: MFC r200130 (partly): /usr/share/examples/etc/rc.firewall6 was also obsoleted. Modified: stable/8/ObsoleteFiles.inc (contents, props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Mon Apr 26 13:48:22 2010 (r207223) +++ stable/8/ObsoleteFiles.inc Mon Apr 26 15:01:14 2010 (r207224) @@ -17,6 +17,7 @@ # 20100408: unify rc.firewall and rc.firewall6. OLD_FILES+=etc/rc.d/ip6fw OLD_FILES+=etc/rc.firewall6 +OLD_FILES+=usr/share/examples/etc/rc.firewall6 # 20100330: [ia64] Sync with 9-current .if ${TARGET_ARCH} == "ia64" OLD_FILES+=usr/include/machine/nexusvar.h From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 15:31:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D23E1106566C; Mon, 26 Apr 2010 15:31:58 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C13D98FC18; Mon, 26 Apr 2010 15:31: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 o3QFVwOT023717; Mon, 26 Apr 2010 15:31:58 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QFVwVP023713; Mon, 26 Apr 2010 15:31:58 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004261531.o3QFVwVP023713@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 26 Apr 2010 15:31: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: r207225 - in head: etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 15:31:59 -0000 Author: ume Date: Mon Apr 26 15:31:58 2010 New Revision: 207225 URL: http://svn.freebsd.org/changeset/base/207225 Log: Better handling of ipv6_default_interface using net.inet6.ip6.use_defaultzone=1. Now, it works IPv6 link-local unicast addresses as well as IPv6 link-local multicast addresses. MFC after: 1 week Modified: head/etc/defaults/rc.conf head/etc/rc.d/routing head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Apr 26 15:01:14 2010 (r207224) +++ head/etc/defaults/rc.conf Mon Apr 26 15:31:58 2010 (r207225) @@ -470,8 +470,8 @@ route6d_flags="" # Flags to IPv6 routin #ipv6_prefix_ed0="fec0:0000:0000:0001 fec0:0000:0000:0002" # Examples for rtr. #ipv6_prefix_ep0="fec0:0000:0000:0003 fec0:0000:0000:0004" # Examples for rtr. ipv6_default_interface="NO" # Default output interface for scoped addrs. - # Now this works only for IPv6 link local - # multicast addrs. + # This works only with + # ipv6_gateway_enable="NO". rtsol_flags="" # Flags to IPv6 router solicitation. rtsold_enable="NO" # Set to YES to enable an IPv6 router # solicitation daemon. Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Mon Apr 26 15:01:14 2010 (r207224) +++ head/etc/rc.d/routing Mon Apr 26 15:31:58 2010 (r207225) @@ -210,34 +210,24 @@ static_inet6() ;; esac - # Disallow unicast packets without outgoing scope identifiers, - # or route such packets to a "default" interface, if it is specified. + # Disallow link-local unicast packets without outgoing scope + # identifiers. However, if you set "ipv6_default_interface", + # for the host case, you will allow to omit the identifiers. + # Under this configuration, the packets will go to the default + # interface. route ${_action} -inet6 fe80:: -prefixlen 10 ::1 -reject + route ${_action} -inet6 ff02:: -prefixlen 16 ::1 -reject case ${ipv6_default_interface} in '') - route ${_action} -inet6 ff02:: -prefixlen 16 ::1 -reject ;; *) - laddr=`network6_getladdr ${ipv6_default_interface}` - route ${_action} -inet6 ff02:: ${laddr} -prefixlen 16 -interface - - # Disable installing the default interface with the - # case net.inet6.ip6.forwarding=0 and - # the interface with no ND6_IFF_ACCEPT_RTADV - # to avoid conflict between the default router list and - # the manual configured default route. + # Disable installing the default interface when we act + # as router to avoid conflict between the default + # router list and the manual configured default route. if ! checkyesno ipv6_gateway_enable; then - ifconfig ${ipv6_default_interface} nd6 | \ - while read proto options - do - case "${proto}:${options}" in - nd6:*ACCEPT_RTADV*) - ifconfig ${ipv6_default_interface} inet6 defaultif - break - ;; - esac - done + ifconfig ${ipv6_default_interface} inet6 defaultif + sysctl net.inet6.ip6.use_defaultzone=1 fi ;; esac Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Apr 26 15:01:14 2010 (r207224) +++ head/share/man/man5/rc.conf.5 Mon Apr 26 15:31:58 2010 (r207225) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2010 +.Dd April 27, 2010 .Dt RC.CONF 5 .Os .Sh NAME @@ -1370,7 +1370,7 @@ configured on that interface. If not set to .Dq Li NO , this is the default output interface for scoped addresses. -Now this works only for IPv6 link local multicast addresses. +This works only with ipv6_gateway_enable="NO". .It Va ip6addrctl_enable .Pq Vt bool If set to From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 16:20:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A60B6106564A; Mon, 26 Apr 2010 16:20:19 +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 7B9AF8FC0A; Mon, 26 Apr 2010 16:20: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 o3QGKJEG034827; Mon, 26 Apr 2010 16:20:19 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QGKJAp034826; Mon, 26 Apr 2010 16:20:19 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201004261620.o3QGKJAp034826@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 26 Apr 2010 16:20:19 +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: r207226 - stable/8/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 16:20:19 -0000 Author: jh Date: Mon Apr 26 16:20:18 2010 New Revision: 207226 URL: http://svn.freebsd.org/changeset/base/207226 Log: MFC r206859: Fix ddb(4) "show geom addr" command when INVARIANTS is enabled. Don't assert that the topology lock is held when g_valid_obj() is called from debugger. Modified: stable/8/sys/geom/geom_subr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/geom/geom_subr.c ============================================================================== --- stable/8/sys/geom/geom_subr.c Mon Apr 26 15:31:58 2010 (r207225) +++ stable/8/sys/geom/geom_subr.c Mon Apr 26 16:20:18 2010 (r207226) @@ -59,6 +59,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef KDB +#include +#endif + struct class_list_head g_classes = LIST_HEAD_INITIALIZER(g_classes); static struct g_tailq_head geoms = TAILQ_HEAD_INITIALIZER(geoms); char *g_wait_event, *g_wait_up, *g_wait_down, *g_wait_sim; @@ -1010,12 +1014,11 @@ g_getattr__(const char *attr, struct g_c #if defined(DIAGNOSTIC) || defined(DDB) /* - * This function walks (topologically unsafely) the mesh and return a - * non-zero integer if it finds the argument pointer is an object. - * The return value indicates which type of object it is belived to be. - * If topology is not locked, this function is potentially dangerous, - * but since it is for debugging purposes and can be useful for instance - * from DDB, we do not assert topology lock is held. + * This function walks the mesh and returns a non-zero integer if it + * finds the argument pointer is an object. The return value indicates + * which type of object it is believed to be. If topology is not locked, + * this function is potentially dangerous, but we don't assert that the + * topology lock is held when called from debugger. */ int g_valid_obj(void const *ptr) @@ -1025,7 +1028,10 @@ g_valid_obj(void const *ptr) struct g_consumer *cp; struct g_provider *pp; - g_topology_assert(); +#ifdef KDB + if (kdb_active == 0) +#endif + g_topology_assert(); LIST_FOREACH(mp, &g_classes, class) { if (ptr == mp) From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 16:57:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F3441065670; Mon, 26 Apr 2010 16:57:07 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB338FC19; Mon, 26 Apr 2010 16:57:05 +0000 (UTC) Received: by bwz8 with SMTP id 8so11392233bwz.3 for ; Mon, 26 Apr 2010 09:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=VL9seA1rH9H4emwMrKXQfRxieqs+p3XVJt9w98ZzjUk=; b=jJ/Ritr/xjg9gXZNZIFDXsQKX1CSz3SUBpcKxEQL0zFGLWQvMvUmm8Sx+ZH0Mk3AYQ q4W01jXif+rRE1UrDVvltrOZDYRBEIDMWU5ZF/kT27481Tc2ModlOnirYAmFQ1IbzYi6 /xRwSkzVZBeKSFYkMuvYl5vzS3WxXSdebo2bM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=dyupl8DbfXl7QbJjLeP/MFKALjn+kg9j0l08H1XKXaAfyAUJ8z/2ciNRFEYz1EMCeY WEYnwGtCgJK36iIf2vIG6jyO2eSeb8RC32Ncu7yph6pPvQ6E5BTVNCG045zEzV+Y7uHm cUGcDEeTwguJwtTcX347z6cv5dHEF26n/EAto= MIME-Version: 1.0 Received: by 10.204.30.208 with SMTP id v16mr2785743bkc.187.1272301021354; Mon, 26 Apr 2010 09:57:01 -0700 (PDT) Received: by 10.204.79.3 with HTTP; Mon, 26 Apr 2010 09:57:01 -0700 (PDT) In-Reply-To: <201004240736.o3O7aXVX062189@svn.freebsd.org> References: <201004240736.o3O7aXVX062189@svn.freebsd.org> Date: Mon, 26 Apr 2010 20:57:01 +0400 Message-ID: From: pluknet To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207142 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 16:57:07 -0000 On 24 April 2010 11:36, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Sat Apr 24 07:36:33 2010 > New Revision: 207142 > URL: http://svn.freebsd.org/changeset/base/207142 > > Log: > =A0Fix build for UFS without SOFTUPDATES. > > Modified: > =A0head/sys/ufs/ffs/ffs_softdep.c > > Modified: head/sys/ufs/ffs/ffs_softdep.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/ufs/ffs/ffs_softdep.c =A0 =A0 =A0Sat Apr 24 07:05:35 2010 = =A0 =A0 =A0 =A0(r207141) > +++ head/sys/ufs/ffs/ffs_softdep.c =A0 =A0 =A0Sat Apr 24 07:36:33 2010 = =A0 =A0 =A0 =A0(r207142) > @@ -232,7 +232,8 @@ softdep_setup_directory_add(bp, dp, diro > =A0} > > =A0void > -softdep_change_directoryentry_offset(dp, base, oldloc, newloc, entrysize= ) > +softdep_change_directoryentry_offset(bp, dp, base, oldloc, newloc, entry= size) > + =A0 =A0 =A0 struct buf *bp; > =A0 =A0 =A0 =A0struct inode *dp; > =A0 =A0 =A0 =A0caddr_t base; > =A0 =A0 =A0 =A0caddr_t oldloc; make universe still doesn't pass: several arm, mips, powerpc configs (defined without SU) are still broken. The following functions defined only for SU case: - declared in ffs_extern.h: int softdep_complete_trunc(struct vnode *, void *); void softdep_unmount(struct mount *); int softdep_move_dependencies(struct buf *, struct buf *); void softdep_setup_blkfree(struct mount *, struct buf *, ufs2_daddr_t, i= nt, struct workhead *); void softdep_setup_inofree(struct mount *, struct buf *, ino_t, struct workhead *); void softdep_setup_sbupdate(struct ufsmount *, struct fs *, struct buf *= ); void *softdep_setup_trunc(struct vnode *vp, off_t length, int flags); int softdep_prealloc(struct vnode *, int); int softdep_journal_lookup(struct mount *, struct vnode **); - declared in ufs_extern.h void softdep_setup_unlink(struct inode *, struct inode *); void softdep_setup_create(struct inode *, struct inode *); void softdep_revert_create(struct inode *, struct inode *); void softdep_setup_rmdir(struct inode *, struct inode *); void softdep_revert_rmdir(struct inode *, struct inode *); void softdep_setup_link(struct inode *, struct inode *); void softdep_revert_link(struct inode *, struct inode *); void softdep_setup_dotdot_link(struct inode *, struct inode *); void softdep_setup_mkdir(struct inode *, struct inode *); void softdep_revert_mkdir(struct inode *, struct inode *); Fixing is not obvios for me. Some of non-SU stub functions return 0, and some of them panic. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 17:03:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75E0B1065670; Mon, 26 Apr 2010 17:03:56 +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 62FEE8FC1B; Mon, 26 Apr 2010 17:03: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 o3QH3uUq044503; Mon, 26 Apr 2010 17:03:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QH3uIr044496; Mon, 26 Apr 2010 17:03:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261703.o3QH3uIr044496@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 17:03:56 +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: r207227 - in stable/8/sys: amd64/conf boot/forth conf dev/sge i386/conf modules modules/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 17:03:56 -0000 Author: yongari Date: Mon Apr 26 17:03:56 2010 New Revision: 207227 URL: http://svn.freebsd.org/changeset/base/207227 Log: MFC r206625: Add driver for Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet. This driver was written by Alexander Pohoyda and greatly enhanced by Nikolay Denev. I don't have these hardwares but this driver was tested by Nikolay Denev and xclin. Because SiS didn't release data sheet for this controller, programming information came from Linux driver and OpenSolaris. Unlike other open source driver for SiS190/191, sge(4) takes full advantage of TX/RX checksum offloading and does not require additional copy operation in RX handler. The controller seems to have advanced offloading features like VLAN hardware tag insertion/stripping, TCP segmentation offload(TSO) as well as jumbo frame support but these features are not available yet. Special thanks to xclin cs dot nctu dot edu dot tw> who sent fix for receiving VLAN oversized frames. Added: stable/8/sys/dev/sge/ - copied from r206625, head/sys/dev/sge/ stable/8/sys/modules/sge/ - copied from r206625, head/sys/modules/sge/ Modified: stable/8/sys/amd64/conf/GENERIC stable/8/sys/boot/forth/loader.conf stable/8/sys/conf/NOTES stable/8/sys/conf/files stable/8/sys/i386/conf/GENERIC stable/8/sys/modules/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/amd64/conf/GENERIC ============================================================================== --- stable/8/sys/amd64/conf/GENERIC Mon Apr 26 16:20:18 2010 (r207226) +++ stable/8/sys/amd64/conf/GENERIC Mon Apr 26 17:03:56 2010 (r207227) @@ -224,6 +224,7 @@ device pcn # AMD Am79C97x PCI 10/100 ( device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') +device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) Modified: stable/8/sys/boot/forth/loader.conf ============================================================================== --- stable/8/sys/boot/forth/loader.conf Mon Apr 26 16:20:18 2010 (r207226) +++ stable/8/sys/boot/forth/loader.conf Mon Apr 26 17:03:56 2010 (r207227) @@ -270,6 +270,7 @@ if_rl_load="NO" # RealTek 8129/8139 if_rue_load="NO" # RealTek RTL8150 USB to Fast Ethernet if_sbni_load="NO" # Granch SBNI12 leased line adapters if_sf_load="NO" # Adaptec Duralink PCI (AIC-6915 "starfire") +if_sge_load="NO" # Silicon Integrated Systems SiS190/191 if_sis_load="NO" # Silicon Integrated Systems SiS 900/7016 if_sk_load="NO" # SysKonnect SK-984x series PCI Gigabit Ethernet if_sn_load="NO" # SMC 91Cxx Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Mon Apr 26 16:20:18 2010 (r207226) +++ stable/8/sys/conf/NOTES Mon Apr 26 17:03:56 2010 (r207227) @@ -1906,6 +1906,7 @@ device miibus # This includes dual and quad port cards, as well as one 100baseFX card. # Most of these are 64-bit PCI devices, except for one single port # card which is 32-bit. +# sge: Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet adapter # sis: Support for NICs based on the Silicon Integrated Systems SiS 900, # SiS 7016 and NS DP83815 PCI fast ethernet controller chips. # sk: Support for the SysKonnect SK-984x series PCI gigabit ethernet NICs. @@ -2000,6 +2001,7 @@ device re # RealTek 8139C+/8169/8169S/ device rl # RealTek 8129/8139 device pcn # AMD Am79C97x PCI 10/100 NICs device sf # Adaptec AIC-6915 (``Starfire'') +device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Mon Apr 26 16:20:18 2010 (r207226) +++ stable/8/sys/conf/files Mon Apr 26 17:03:56 2010 (r207227) @@ -1476,6 +1476,7 @@ dev/scd/scd.c optional scd isa dev/scd/scd_isa.c optional scd isa dev/sdhci/sdhci.c optional sdhci pci dev/sf/if_sf.c optional sf pci +dev/sge/if_sge.c optional sge pci dev/si/si.c optional si dev/si/si2_z280.c optional si dev/si/si3_t225.c optional si Modified: stable/8/sys/i386/conf/GENERIC ============================================================================== --- stable/8/sys/i386/conf/GENERIC Mon Apr 26 16:20:18 2010 (r207226) +++ stable/8/sys/i386/conf/GENERIC Mon Apr 26 17:03:56 2010 (r207227) @@ -235,6 +235,7 @@ device pcn # AMD Am79C97x PCI 10/100 ( device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') +device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Mon Apr 26 16:20:18 2010 (r207226) +++ stable/8/sys/modules/Makefile Mon Apr 26 17:03:56 2010 (r207227) @@ -249,6 +249,7 @@ SUBDIR= ${_3dfx} \ sdhci \ sem \ sf \ + sge \ siba_bwn \ siis \ sis \ From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 17:22:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BFB4106566B; Mon, 26 Apr 2010 17:22:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECCC68FC22; Mon, 26 Apr 2010 17:22: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 o3QHM2C6048663; Mon, 26 Apr 2010 17:22:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QHM2Wh048655; Mon, 26 Apr 2010 17:22:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261722.o3QHM2Wh048655@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 17:22: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: r207228 - in stable/7/sys: amd64/conf boot/forth conf dev/sge i386/conf modules modules/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 17:22:03 -0000 Author: yongari Date: Mon Apr 26 17:22:02 2010 New Revision: 207228 URL: http://svn.freebsd.org/changeset/base/207228 Log: MFC r206625: Add driver for Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet. This driver was written by Alexander Pohoyda and greatly enhanced by Nikolay Denev. I don't have these hardwares but this driver was tested by Nikolay Denev and xclin. Because SiS didn't release data sheet for this controller, programming information came from Linux driver and OpenSolaris. Unlike other open source driver for SiS190/191, sge(4) takes full advantage of TX/RX checksum offloading and does not require additional copy operation in RX handler. The controller seems to have advanced offloading features like VLAN hardware tag insertion/stripping, TCP segmentation offload(TSO) as well as jumbo frame support but these features are not available yet. Special thanks to xclin cs dot nctu dot edu dot tw> who sent fix for receiving VLAN oversized frames. Added: stable/7/sys/dev/sge/ - copied from r206625, head/sys/dev/sge/ stable/7/sys/modules/sge/ - copied from r206625, head/sys/modules/sge/ Modified: stable/7/sys/amd64/conf/GENERIC stable/7/sys/boot/forth/loader.conf stable/7/sys/conf/NOTES stable/7/sys/conf/files stable/7/sys/dev/sge/if_sge.c stable/7/sys/i386/conf/GENERIC stable/7/sys/modules/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/conf/GENERIC ============================================================================== --- stable/7/sys/amd64/conf/GENERIC Mon Apr 26 17:03:56 2010 (r207227) +++ stable/7/sys/amd64/conf/GENERIC Mon Apr 26 17:22:02 2010 (r207228) @@ -213,6 +213,7 @@ device pcn # AMD Am79C97x PCI 10/100 ( device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') +device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) Modified: stable/7/sys/boot/forth/loader.conf ============================================================================== --- stable/7/sys/boot/forth/loader.conf Mon Apr 26 17:03:56 2010 (r207227) +++ stable/7/sys/boot/forth/loader.conf Mon Apr 26 17:22:02 2010 (r207228) @@ -261,6 +261,7 @@ if_rl_load="NO" # RealTek 8129/8139 if_rue_load="NO" # RealTek RTL8150 USB to Fast Ethernet if_sbni_load="NO" # Granch SBNI12 leased line adapters if_sf_load="NO" # Adaptec Duralink PCI (AIC-6915 "starfire") +if_sge_load="NO" # Silicon Integrated Systems SiS190/191 if_sis_load="NO" # Silicon Integrated Systems SiS 900/7016 if_sk_load="NO" # SysKonnect SK-984x series PCI Gigabit Ethernet if_sn_load="NO" # SMC 91Cxx Modified: stable/7/sys/conf/NOTES ============================================================================== --- stable/7/sys/conf/NOTES Mon Apr 26 17:03:56 2010 (r207227) +++ stable/7/sys/conf/NOTES Mon Apr 26 17:22:02 2010 (r207228) @@ -1800,6 +1800,7 @@ device miibus # This includes dual and quad port cards, as well as one 100baseFX card. # Most of these are 64-bit PCI devices, except for one single port # card which is 32-bit. +# sge: Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet adapter # sis: Support for NICs based on the Silicon Integrated Systems SiS 900, # SiS 7016 and NS DP83815 PCI fast ethernet controller chips. # sbsh: Support for Granch SBNI16 SHDSL modem PCI adapters @@ -1897,6 +1898,7 @@ device rl # RealTek 8129/8139 device pcn # AMD Am79C97x PCI 10/100 NICs device sf # Adaptec AIC-6915 (``Starfire'') device sbsh # Granch SBNI16 SHDSL modem +device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Mon Apr 26 17:03:56 2010 (r207227) +++ stable/7/sys/conf/files Mon Apr 26 17:22:02 2010 (r207228) @@ -1110,6 +1110,7 @@ dev/scd/scd.c optional scd isa dev/scd/scd_isa.c optional scd isa dev/sdhci/sdhci.c optional sdhci pci dev/sf/if_sf.c optional sf pci +dev/sge/if_sge.c optional sge pci dev/si/si.c optional si dev/si/si2_z280.c optional si dev/si/si3_t225.c optional si Modified: stable/7/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Wed Apr 14 20:45:33 2010 (r206625) +++ stable/7/sys/dev/sge/if_sge.c Mon Apr 26 17:22:02 2010 (r207228) @@ -467,7 +467,7 @@ sge_rxfilter(struct sge_softc *sc) } rxfilt |= AcceptMulticast; /* Now program new ones. */ - if_maddr_rlock(ifp); + IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -475,7 +475,7 @@ sge_rxfilter(struct sge_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN); hashes[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } - if_maddr_runlock(ifp); + IF_ADDR_UNLOCK(ifp); done: CSR_WRITE_2(sc, RxMacControl, rxfilt | 0x02); CSR_WRITE_4(sc, RxHashTable, hashes[0]); Modified: stable/7/sys/i386/conf/GENERIC ============================================================================== --- stable/7/sys/i386/conf/GENERIC Mon Apr 26 17:03:56 2010 (r207227) +++ stable/7/sys/i386/conf/GENERIC Mon Apr 26 17:22:02 2010 (r207228) @@ -224,6 +224,7 @@ device pcn # AMD Am79C97x PCI 10/100 ( device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') +device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Mon Apr 26 17:03:56 2010 (r207227) +++ stable/7/sys/modules/Makefile Mon Apr 26 17:22:02 2010 (r207228) @@ -253,6 +253,7 @@ SUBDIR= ${_3dfx} \ sdhci \ sem \ sf \ + sge \ ${_sio} \ sis \ sk \ From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 17:24:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7740106564A; Mon, 26 Apr 2010 17:24:10 +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 D5DA38FC19; Mon, 26 Apr 2010 17:24: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 o3QHOAGv049214; Mon, 26 Apr 2010 17:24:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QHOAnw049212; Mon, 26 Apr 2010 17:24:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004261724.o3QHOAnw049212@svn.freebsd.org> From: Xin LI Date: Mon, 26 Apr 2010 17:24: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: r207229 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 17:24:11 -0000 Author: delphij Date: Mon Apr 26 17:24:10 2010 New Revision: 207229 URL: http://svn.freebsd.org/changeset/base/207229 Log: MFC r198443 (by antoine): Add more obsolete man pages. Requested by: Alex Kozlov Ok'ed by: antoine Modified: stable/8/ObsoleteFiles.inc (contents, props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Mon Apr 26 17:22:02 2010 (r207228) +++ stable/8/ObsoleteFiles.inc Mon Apr 26 17:24:10 2010 (r207229) @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100327: fusword.9 and susword.9 removed +OLD_FILES+=usr/share/man/man9/fusword.9.gz +OLD_FILES+=usr/share/man/man9/susword.9.gz # 20100408: unify rc.firewall and rc.firewall6. OLD_FILES+=etc/rc.d/ip6fw OLD_FILES+=etc/rc.firewall6 @@ -63,6 +66,49 @@ OLD_FILES+=usr/libexec/lukemftpd OLD_FILES+=usr/share/man/man5/ftpd.conf.5.gz OLD_FILES+=usr/share/man/man5/ftpusers.5.gz OLD_FILES+=usr/share/man/man8/lukemftpd.8.gz +# 20090812: net80211 documentation overhaul +OLD_FILES+=usr/share/man/man9/ieee80211_add_rates.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_add_xrates.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_alloc_node.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_attach.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_begin_scan.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_cfgget.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_cfgset.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_chan2ieee.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_chan2mode.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_create_ibss.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_crypto_attach.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_crypto_detach.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_decap.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_dump_pkt.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_dup_bss.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_encap.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_end_scan.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_find_node.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_fix_rate.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_free_allnodes.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_ieee2mhz.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_ioctl.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_lookup_node.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_media2rate.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_media_change.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_media_init.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_media_status.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_mhz2ieee.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_next_scan.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_node_attach.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_node_detach.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_node_lateattach.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_print_essid.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_proto_attach.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_proto_detach.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_rate2media.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_recv_mgmt.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_send_mgmt.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_setmode.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_timeout_nodes.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_watchdog.9.gz +OLD_FILES+=usr/share/man/man9/ieee80211_wep_crypt.9.gz # 20090801: vimage.h removed in favour of vnet.h OLD_FILES+=usr/include/sys/vimage.h # 20090719: library version bump for 8.0 From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 17:27:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BB4D106566C; Mon, 26 Apr 2010 17:27:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A2B18FC16; Mon, 26 Apr 2010 17:27:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3QHR8Sf049941; Mon, 26 Apr 2010 17:27:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QHR836049939; Mon, 26 Apr 2010 17:27:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261727.o3QHR836049939@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 17:27:08 +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: r207230 - stable/8/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 17:27:08 -0000 Author: yongari Date: Mon Apr 26 17:27:08 2010 New Revision: 207230 URL: http://svn.freebsd.org/changeset/base/207230 Log: MFC r206628: Add sge(4) to the list of supported network interface. Modified: stable/8/usr.sbin/sysinstall/devices.c Directory Properties: stable/8/usr.sbin/sysinstall/ (props changed) Modified: stable/8/usr.sbin/sysinstall/devices.c ============================================================================== --- stable/8/usr.sbin/sysinstall/devices.c Mon Apr 26 17:24:10 2010 (r207229) +++ stable/8/usr.sbin/sysinstall/devices.c Mon Apr 26 17:27:08 2010 (r207230) @@ -150,6 +150,7 @@ static struct _devname { NETWORK("rue", "RealTek USB Ethernet card"), NETWORK("rum", "Ralink Technology USB IEEE 802.11 wireless adapter"), NETWORK("sf", "Adaptec AIC-6915 PCI Ethernet card"), + NETWORK("sge", "Silicon Integrated Systems SiS190/191 Ethernet"), NETWORK("sis", "SiS 900/SiS 7016 PCI Ethernet card"), #ifdef PC98 NETWORK("snc", "SONIC Ethernet card"), From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 17:28:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77BC6106566B; Mon, 26 Apr 2010 17:28:12 +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 6653E8FC0A; Mon, 26 Apr 2010 17:28: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 o3QHSC5a050232; Mon, 26 Apr 2010 17:28:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QHSCIL050230; Mon, 26 Apr 2010 17:28:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261728.o3QHSCIL050230@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 17:28:12 +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: r207231 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 17:28:12 -0000 Author: yongari Date: Mon Apr 26 17:28:12 2010 New Revision: 207231 URL: http://svn.freebsd.org/changeset/base/207231 Log: MFC r206628: Add sge(4) to the list of supported network interface. Modified: stable/7/usr.sbin/sysinstall/devices.c Directory Properties: stable/7/usr.sbin/sysinstall/ (props changed) Modified: stable/7/usr.sbin/sysinstall/devices.c ============================================================================== --- stable/7/usr.sbin/sysinstall/devices.c Mon Apr 26 17:27:08 2010 (r207230) +++ stable/7/usr.sbin/sysinstall/devices.c Mon Apr 26 17:28:12 2010 (r207231) @@ -142,6 +142,7 @@ static struct _devname { NETWORK("rl", "RealTek 8129/8139 PCI Ethernet card"), NETWORK("rue", "RealTek USB Ethernet card"), NETWORK("sf", "Adaptec AIC-6915 PCI Ethernet card"), + NETWORK("sge", "Silicon Integrated Systems SiS190/191 Ethernet"), NETWORK("sis", "SiS 900/SiS 7016 PCI Ethernet card"), #ifdef PC98 NETWORK("snc", "SONIC Ethernet card"), From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 17:30:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F05CC1065673; Mon, 26 Apr 2010 17:30:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDD8B8FC15; Mon, 26 Apr 2010 17:30: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 o3QHUfNw050874; Mon, 26 Apr 2010 17:30:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QHUfha050868; Mon, 26 Apr 2010 17:30:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261730.o3QHUfha050868@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 17:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207232 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 17:30:42 -0000 Author: yongari Date: Mon Apr 26 17:30:41 2010 New Revision: 207232 URL: http://svn.freebsd.org/changeset/base/207232 Log: MFC r206631: Add sge(4) man page and hook up sge(4) to the build. Also add Xr to appropriate man pages. Added: stable/8/share/man/man4/sge.4 - copied unchanged from r206631, head/share/man/man4/sge.4 Modified: stable/8/share/man/man4/Makefile stable/8/share/man/man4/altq.4 stable/8/share/man/man4/miibus.4 stable/8/share/man/man4/vlan.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Mon Apr 26 17:28:12 2010 (r207231) +++ stable/8/share/man/man4/Makefile Mon Apr 26 17:30:41 2010 (r207232) @@ -342,6 +342,7 @@ MAN= aac.4 \ sem.4 \ ses.4 \ sf.4 \ + sge.4 \ si.4 \ sio.4 \ siis.4 \ Modified: stable/8/share/man/man4/altq.4 ============================================================================== --- stable/8/share/man/man4/altq.4 Mon Apr 26 17:28:12 2010 (r207231) +++ stable/8/share/man/man4/altq.4 Mon Apr 26 17:30:41 2010 (r207232) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 26, 2009 +.Dd April 14, 2010 .Dt ALTQ 4 .Os .Sh NAME @@ -151,6 +151,7 @@ They have been applied to the following .Xr rl 4 , .Xr rum 4 , .Xr sf 4 , +.Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , Modified: stable/8/share/man/man4/miibus.4 ============================================================================== --- stable/8/share/man/man4/miibus.4 Mon Apr 26 17:28:12 2010 (r207231) +++ stable/8/share/man/man4/miibus.4 Mon Apr 26 17:30:41 2010 (r207232) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd April 14, 2010 .Dt MIIBUS 4 .Os .Sh NAME @@ -97,6 +97,8 @@ RealTek 8129/8139 RealTek RTL8150 USB To Fast Ethernet .It Xr sf 4 Adaptec AIC-6915 +.It Xr sge 4 +Silicon Integrated Systems SiS190/191 Ethernet .It Xr sis 4 Silicon Integrated Systems SiS 900/SiS 7016 .It Xr sk 4 @@ -158,6 +160,7 @@ but as a result are not well behaved new .Xr rl 4 , .Xr rue 4 , .Xr sf 4 , +.Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , Copied: stable/8/share/man/man4/sge.4 (from r206631, head/share/man/man4/sge.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/sge.4 Mon Apr 26 17:30:41 2010 (r207232, copy of r206631, head/share/man/man4/sge.4) @@ -0,0 +1,120 @@ +.\" Copyright (c) 2010 Pyun YongHyeon +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 14, 2010 +.Dt SGE 4 +.Os +.Sh NAME +.Nm sge +.Nd Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device miibus" +.Cd "device sge" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_sge="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for SiS190 Fast Ethernet +controllers and SiS191 Fast/Gigabit Ethernet controllers. +.Pp +All LOMs supported by the +.Nm +driver have TCP/UDP/IP checksum offload for transmit and receive. +Due to lack of documentation more offloading features like TCP +segmentation offload (TSO), hardware VLAN tag stripping/insertion +features, Wake On Lan (WOL), Jumbo frame and an interrupt moderation +mechanism are not supported yet. +.Pp +The +.Nm +driver supports the following media types: +.Bl -tag -width ".Cm 10baseT/UTP" +.It Cm autoselect +Enable autoselection of the media type and options. +The user can manually override +the autoselected mode by adding media options to +.Xr rc.conf 5 . +.It Cm 10baseT/UTP +Set 10Mbps operation. +.It Cm 100baseTX +Set 100Mbps (Fast Ethernet) operation. +.It Cm 1000baseTX +Set 1000baseTX operation over twisted pair. +.El +.Pp +The +.Nm +driver supports the following media options: +.Bl -tag -width ".Cm full-duplex" +.It Cm full-duplex +Force full duplex operation. +.It Cm half-duplex +Force half duplex operation. +.El +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +device driver provides support for the following Ethernet controllers: +.Pp +.Bl -bullet -compact +.It +SiS190 Fast Ethernet controller +.It +SiS191 Fast/Gigabit Ethernet controller +.El +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr miibus 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +driver was written by +.An Alexander Pohoyda +.Aq alexander.pohoyda@gmx.net . +And enhanced by +.An Nikolay Denev +.Aq ndenev@gmail.com . +It first appeared in +.Fx 8.1 . Modified: stable/8/share/man/man4/vlan.4 ============================================================================== --- stable/8/share/man/man4/vlan.4 Mon Apr 26 17:28:12 2010 (r207231) +++ stable/8/share/man/man4/vlan.4 Mon Apr 26 17:30:41 2010 (r207232) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd April 14, 2010 .Dt VLAN 4 .Os .Sh NAME @@ -172,6 +172,7 @@ natively: .Xr nve 4 , .Xr rl 4 , .Xr sf 4 , +.Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 17:43:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBCB41065670; Mon, 26 Apr 2010 17:43:46 +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 CF4EA8FC08; Mon, 26 Apr 2010 17:43: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 o3QHhkHJ053907; Mon, 26 Apr 2010 17:43:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QHhkio053901; Mon, 26 Apr 2010 17:43:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261743.o3QHhkio053901@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 17:43:46 +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: r207233 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 17:43:47 -0000 Author: yongari Date: Mon Apr 26 17:43:46 2010 New Revision: 207233 URL: http://svn.freebsd.org/changeset/base/207233 Log: MFC r206631: Add sge(4) man page and hook up sge(4) to the build. Also add Xr to appropriate man pages. Added: stable/7/share/man/man4/sge.4 - copied unchanged from r206631, head/share/man/man4/sge.4 Modified: stable/7/share/man/man4/Makefile stable/7/share/man/man4/altq.4 stable/7/share/man/man4/miibus.4 stable/7/share/man/man4/vlan.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Mon Apr 26 17:30:41 2010 (r207232) +++ stable/7/share/man/man4/Makefile Mon Apr 26 17:43:46 2010 (r207233) @@ -310,6 +310,7 @@ MAN= aac.4 \ sem.4 \ ses.4 \ sf.4 \ + sge.4 \ si.4 \ sio.4 \ sis.4 \ Modified: stable/7/share/man/man4/altq.4 ============================================================================== --- stable/7/share/man/man4/altq.4 Mon Apr 26 17:30:41 2010 (r207232) +++ stable/7/share/man/man4/altq.4 Mon Apr 26 17:43:46 2010 (r207233) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd April 14, 2010 .Dt ALTQ 4 .Os .Sh NAME @@ -151,6 +151,7 @@ They have been applied to the following .Xr rl 4 , .Xr rum 4 , .Xr sf 4 , +.Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , Modified: stable/7/share/man/man4/miibus.4 ============================================================================== --- stable/7/share/man/man4/miibus.4 Mon Apr 26 17:30:41 2010 (r207232) +++ stable/7/share/man/man4/miibus.4 Mon Apr 26 17:43:46 2010 (r207233) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd April 14, 2010 .Dt MIIBUS 4 .Os .Sh NAME @@ -97,6 +97,8 @@ RealTek 8129/8139 RealTek RTL8150 USB To Fast Ethernet .It Xr sf 4 Adaptec AIC-6915 +.It Xr sge 4 +Silicon Integrated Systems SiS190/191 Ethernet .It Xr sis 4 Silicon Integrated Systems SiS 900/SiS 7016 .It Xr sk 4 @@ -158,6 +160,7 @@ but as a result are not well behaved new .Xr rl 4 , .Xr rue 4 , .Xr sf 4 , +.Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , Copied: stable/7/share/man/man4/sge.4 (from r206631, head/share/man/man4/sge.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/man/man4/sge.4 Mon Apr 26 17:43:46 2010 (r207233, copy of r206631, head/share/man/man4/sge.4) @@ -0,0 +1,120 @@ +.\" Copyright (c) 2010 Pyun YongHyeon +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 14, 2010 +.Dt SGE 4 +.Os +.Sh NAME +.Nm sge +.Nd Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device miibus" +.Cd "device sge" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_sge="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for SiS190 Fast Ethernet +controllers and SiS191 Fast/Gigabit Ethernet controllers. +.Pp +All LOMs supported by the +.Nm +driver have TCP/UDP/IP checksum offload for transmit and receive. +Due to lack of documentation more offloading features like TCP +segmentation offload (TSO), hardware VLAN tag stripping/insertion +features, Wake On Lan (WOL), Jumbo frame and an interrupt moderation +mechanism are not supported yet. +.Pp +The +.Nm +driver supports the following media types: +.Bl -tag -width ".Cm 10baseT/UTP" +.It Cm autoselect +Enable autoselection of the media type and options. +The user can manually override +the autoselected mode by adding media options to +.Xr rc.conf 5 . +.It Cm 10baseT/UTP +Set 10Mbps operation. +.It Cm 100baseTX +Set 100Mbps (Fast Ethernet) operation. +.It Cm 1000baseTX +Set 1000baseTX operation over twisted pair. +.El +.Pp +The +.Nm +driver supports the following media options: +.Bl -tag -width ".Cm full-duplex" +.It Cm full-duplex +Force full duplex operation. +.It Cm half-duplex +Force half duplex operation. +.El +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +device driver provides support for the following Ethernet controllers: +.Pp +.Bl -bullet -compact +.It +SiS190 Fast Ethernet controller +.It +SiS191 Fast/Gigabit Ethernet controller +.El +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr miibus 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +driver was written by +.An Alexander Pohoyda +.Aq alexander.pohoyda@gmx.net . +And enhanced by +.An Nikolay Denev +.Aq ndenev@gmail.com . +It first appeared in +.Fx 8.1 . Modified: stable/7/share/man/man4/vlan.4 ============================================================================== --- stable/7/share/man/man4/vlan.4 Mon Apr 26 17:30:41 2010 (r207232) +++ stable/7/share/man/man4/vlan.4 Mon Apr 26 17:43:46 2010 (r207233) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2009 +.Dd April 14, 2010 .Dt VLAN 4 .Os .Sh NAME @@ -172,6 +172,7 @@ natively: .Xr nve 4 , .Xr rl 4 , .Xr sf 4 , +.Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 17:54:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CEF01065672; Mon, 26 Apr 2010 17:54:50 +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 0B3748FC0C; Mon, 26 Apr 2010 17:54: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 o3QHsn0w056481; Mon, 26 Apr 2010 17:54:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QHsnn0056479; Mon, 26 Apr 2010 17:54:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261754.o3QHsnn0056479@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 17:54: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: r207234 - stable/8/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 17:54:50 -0000 Author: yongari Date: Mon Apr 26 17:54:49 2010 New Revision: 207234 URL: http://svn.freebsd.org/changeset/base/207234 Log: MFC r206672: Fix include path. Modified: stable/8/sys/dev/sge/if_sge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/sge/if_sge.c ============================================================================== --- stable/8/sys/dev/sge/if_sge.c Mon Apr 26 17:43:46 2010 (r207233) +++ stable/8/sys/dev/sge/if_sge.c Mon Apr 26 17:54:49 2010 (r207234) @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "if_sgereg.h" +#include MODULE_DEPEND(sge, pci, 1, 1, 1); MODULE_DEPEND(sge, ether, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 17:57:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09004106566C; Mon, 26 Apr 2010 17:57:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB7C38FC0A; Mon, 26 Apr 2010 17:57: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 o3QHv8WY057097; Mon, 26 Apr 2010 17:57:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QHv83x057095; Mon, 26 Apr 2010 17:57:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261757.o3QHv83x057095@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 17:57:08 +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: r207235 - stable/7/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 17:57:09 -0000 Author: yongari Date: Mon Apr 26 17:57:08 2010 New Revision: 207235 URL: http://svn.freebsd.org/changeset/base/207235 Log: MFC r206672: Fix include path. Modified: stable/7/sys/dev/sge/if_sge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sge/if_sge.c ============================================================================== --- stable/7/sys/dev/sge/if_sge.c Mon Apr 26 17:54:49 2010 (r207234) +++ stable/7/sys/dev/sge/if_sge.c Mon Apr 26 17:57:08 2010 (r207235) @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "if_sgereg.h" +#include MODULE_DEPEND(sge, pci, 1, 1, 1); MODULE_DEPEND(sge, ether, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 18:02:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8AB7106566C; Mon, 26 Apr 2010 18:02:12 +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 9555D8FC12; Mon, 26 Apr 2010 18:02: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 o3QI2CbX058315; Mon, 26 Apr 2010 18:02:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QI2CmO058308; Mon, 26 Apr 2010 18:02:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261802.o3QI2CmO058308@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 18:02: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: r207236 - in stable/8/sys/dev: age alc ale fxp msk nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 18:02:12 -0000 Author: yongari Date: Mon Apr 26 18:02:12 2010 New Revision: 207236 URL: http://svn.freebsd.org/changeset/base/207236 Log: MFC r206876: With r206844, CSUM_TCP is also set for CSUM_TSO case. Modify drivers to take into account for the change. Basically CSUM_TSO should be checked before checking CSUM_TCP. Modified: stable/8/sys/dev/age/if_age.c stable/8/sys/dev/alc/if_alc.c stable/8/sys/dev/ale/if_ale.c stable/8/sys/dev/fxp/if_fxp.c stable/8/sys/dev/msk/if_msk.c stable/8/sys/dev/nfe/if_nfe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/age/if_age.c ============================================================================== --- stable/8/sys/dev/age/if_age.c Mon Apr 26 17:57:08 2010 (r207235) +++ stable/8/sys/dev/age/if_age.c Mon Apr 26 18:02:12 2010 (r207236) @@ -1629,22 +1629,8 @@ age_encap(struct age_softc *sc, struct m } m = *m_head; - /* Configure Tx IP/TCP/UDP checksum offload. */ - if ((m->m_pkthdr.csum_flags & AGE_CSUM_FEATURES) != 0) { - cflags |= AGE_TD_CSUM; - if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) - cflags |= AGE_TD_TCPCSUM; - if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) - cflags |= AGE_TD_UDPCSUM; - /* Set checksum start offset. */ - cflags |= (poff << AGE_TD_CSUM_PLOADOFFSET_SHIFT); - /* Set checksum insertion position of TCP/UDP. */ - cflags |= ((poff + m->m_pkthdr.csum_data) << - AGE_TD_CSUM_XSUMOFFSET_SHIFT); - } - - /* Configure TSO. */ if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + /* Configure TSO. */ if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) { /* Not TSO but IP/TCP checksum offload. */ cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; @@ -1660,6 +1646,18 @@ age_encap(struct age_softc *sc, struct m /* Set IP/TCP header size. */ cflags |= ip->ip_hl << AGE_TD_IPHDR_LEN_SHIFT; cflags |= tcp->th_off << AGE_TD_TSO_TCPHDR_LEN_SHIFT; + } else if ((m->m_pkthdr.csum_flags & AGE_CSUM_FEATURES) != 0) { + /* Configure Tx IP/TCP/UDP checksum offload. */ + cflags |= AGE_TD_CSUM; + if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) + cflags |= AGE_TD_TCPCSUM; + if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) + cflags |= AGE_TD_UDPCSUM; + /* Set checksum start offset. */ + cflags |= (poff << AGE_TD_CSUM_PLOADOFFSET_SHIFT); + /* Set checksum insertion position of TCP/UDP. */ + cflags |= ((poff + m->m_pkthdr.csum_data) << + AGE_TD_CSUM_XSUMOFFSET_SHIFT); } /* Configure VLAN hardware tag insertion. */ Modified: stable/8/sys/dev/alc/if_alc.c ============================================================================== --- stable/8/sys/dev/alc/if_alc.c Mon Apr 26 17:57:08 2010 (r207235) +++ stable/8/sys/dev/alc/if_alc.c Mon Apr 26 18:02:12 2010 (r207236) @@ -1908,28 +1908,7 @@ alc_encap(struct alc_softc *sc, struct m vtag = (vtag << TD_VLAN_SHIFT) & TD_VLAN_MASK; cflags |= TD_INS_VLAN_TAG; } - /* Configure Tx checksum offload. */ - if ((m->m_pkthdr.csum_flags & ALC_CSUM_FEATURES) != 0) { -#ifdef ALC_USE_CUSTOM_CSUM - cflags |= TD_CUSTOM_CSUM; - /* Set checksum start offset. */ - cflags |= ((poff >> 1) << TD_PLOAD_OFFSET_SHIFT) & - TD_PLOAD_OFFSET_MASK; - /* Set checksum insertion position of TCP/UDP. */ - cflags |= (((poff + m->m_pkthdr.csum_data) >> 1) << - TD_CUSTOM_CSUM_OFFSET_SHIFT) & TD_CUSTOM_CSUM_OFFSET_MASK; -#else - if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) - cflags |= TD_IPCSUM; - if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) - cflags |= TD_TCPCSUM; - if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) - cflags |= TD_UDPCSUM; - /* Set TCP/UDP header offset. */ - cflags |= (poff << TD_L4HDR_OFFSET_SHIFT) & - TD_L4HDR_OFFSET_MASK; -#endif - } else if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { /* Request TSO and set MSS. */ cflags |= TD_TSO | TD_TSO_DESCV1; cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << TD_MSS_SHIFT) & @@ -1961,6 +1940,27 @@ alc_encap(struct alc_softc *sc, struct m } /* Handle remaining fragments. */ idx = 1; + } else if ((m->m_pkthdr.csum_flags & ALC_CSUM_FEATURES) != 0) { + /* Configure Tx checksum offload. */ +#ifdef ALC_USE_CUSTOM_CSUM + cflags |= TD_CUSTOM_CSUM; + /* Set checksum start offset. */ + cflags |= ((poff >> 1) << TD_PLOAD_OFFSET_SHIFT) & + TD_PLOAD_OFFSET_MASK; + /* Set checksum insertion position of TCP/UDP. */ + cflags |= (((poff + m->m_pkthdr.csum_data) >> 1) << + TD_CUSTOM_CSUM_OFFSET_SHIFT) & TD_CUSTOM_CSUM_OFFSET_MASK; +#else + if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) + cflags |= TD_IPCSUM; + if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) + cflags |= TD_TCPCSUM; + if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) + cflags |= TD_UDPCSUM; + /* Set TCP/UDP header offset. */ + cflags |= (poff << TD_L4HDR_OFFSET_SHIFT) & + TD_L4HDR_OFFSET_MASK; +#endif } for (; idx < nsegs; idx++) { desc = &sc->alc_rdata.alc_tx_ring[prod]; Modified: stable/8/sys/dev/ale/if_ale.c ============================================================================== --- stable/8/sys/dev/ale/if_ale.c Mon Apr 26 17:57:08 2010 (r207235) +++ stable/8/sys/dev/ale/if_ale.c Mon Apr 26 18:02:12 2010 (r207236) @@ -1737,8 +1737,14 @@ ale_encap(struct ale_softc *sc, struct m bus_dmamap_sync(sc->ale_cdata.ale_tx_tag, map, BUS_DMASYNC_PREWRITE); m = *m_head; - /* Configure Tx checksum offload. */ - if ((m->m_pkthdr.csum_flags & ALE_CSUM_FEATURES) != 0) { + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + /* Request TSO and set MSS. */ + cflags |= ALE_TD_TSO; + cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << ALE_TD_MSS_SHIFT); + /* Set IP/TCP header size. */ + cflags |= ip->ip_hl << ALE_TD_IPHDR_LEN_SHIFT; + cflags |= tcp->th_off << ALE_TD_TCPHDR_LEN_SHIFT; + } else if ((m->m_pkthdr.csum_flags & ALE_CSUM_FEATURES) != 0) { /* * AR81xx supports Tx custom checksum offload feature * that offloads single 16bit checksum computation. @@ -1769,15 +1775,6 @@ ale_encap(struct ale_softc *sc, struct m ALE_TD_CSUM_XSUMOFFSET_SHIFT); } - if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - /* Request TSO and set MSS. */ - cflags |= ALE_TD_TSO; - cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << ALE_TD_MSS_SHIFT); - /* Set IP/TCP header size. */ - cflags |= ip->ip_hl << ALE_TD_IPHDR_LEN_SHIFT; - cflags |= tcp->th_off << ALE_TD_TCPHDR_LEN_SHIFT; - } - /* Configure VLAN hardware tag insertion. */ if ((m->m_flags & M_VLANTAG) != 0) { vtag = ALE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag); Modified: stable/8/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/8/sys/dev/fxp/if_fxp.c Mon Apr 26 17:57:08 2010 (r207235) +++ stable/8/sys/dev/fxp/if_fxp.c Mon Apr 26 18:02:12 2010 (r207236) @@ -1417,60 +1417,6 @@ fxp_encap(struct fxp_softc *sc, struct m FXP_IPCB_HARDWAREPARSING_ENABLE; m = *m_head; - /* - * Deal with TCP/IP checksum offload. Note that - * in order for TCP checksum offload to work, - * the pseudo header checksum must have already - * been computed and stored in the checksum field - * in the TCP header. The stack should have - * already done this for us. - */ - if (m->m_pkthdr.csum_flags & FXP_CSUM_FEATURES) { - txp->tx_cb->ipcb_ip_schedule = FXP_IPCB_TCPUDP_CHECKSUM_ENABLE; - if (m->m_pkthdr.csum_flags & CSUM_TCP) - txp->tx_cb->ipcb_ip_schedule |= FXP_IPCB_TCP_PACKET; - -#ifdef FXP_IP_CSUM_WAR - /* - * XXX The 82550 chip appears to have trouble - * dealing with IP header checksums in very small - * datagrams, namely fragments from 1 to 3 bytes - * in size. For example, say you want to transmit - * a UDP packet of 1473 bytes. The packet will be - * fragmented over two IP datagrams, the latter - * containing only one byte of data. The 82550 will - * botch the header checksum on the 1-byte fragment. - * As long as the datagram contains 4 or more bytes - * of data, you're ok. - * - * The following code attempts to work around this - * problem: if the datagram is less than 38 bytes - * in size (14 bytes ether header, 20 bytes IP header, - * plus 4 bytes of data), we punt and compute the IP - * header checksum by hand. This workaround doesn't - * work very well, however, since it can be fooled - * by things like VLAN tags and IP options that make - * the header sizes/offsets vary. - */ - - if (m->m_pkthdr.csum_flags & CSUM_IP) { - if (m->m_pkthdr.len < 38) { - struct ip *ip; - m->m_data += ETHER_HDR_LEN; - ip = mtod(m, struct ip *); - ip->ip_sum = in_cksum(m, ip->ip_hl << 2); - m->m_data -= ETHER_HDR_LEN; - m->m_pkthdr.csum_flags &= ~CSUM_IP; - } else { - txp->tx_cb->ipcb_ip_activation_high = - FXP_IPCB_HARDWAREPARSING_ENABLE; - txp->tx_cb->ipcb_ip_schedule |= - FXP_IPCB_IP_CHECKSUM_ENABLE; - } - } -#endif - } - if (m->m_pkthdr.csum_flags & CSUM_TSO) { /* * 82550/82551 requires ethernet/IP/TCP headers must be @@ -1539,6 +1485,58 @@ fxp_encap(struct fxp_softc *sc, struct m tcp_payload = m->m_pkthdr.len - ip_off - (ip->ip_hl << 2); tcp_payload -= tcp->th_off << 2; *m_head = m; + } else if (m->m_pkthdr.csum_flags & FXP_CSUM_FEATURES) { + /* + * Deal with TCP/IP checksum offload. Note that + * in order for TCP checksum offload to work, + * the pseudo header checksum must have already + * been computed and stored in the checksum field + * in the TCP header. The stack should have + * already done this for us. + */ + txp->tx_cb->ipcb_ip_schedule = FXP_IPCB_TCPUDP_CHECKSUM_ENABLE; + if (m->m_pkthdr.csum_flags & CSUM_TCP) + txp->tx_cb->ipcb_ip_schedule |= FXP_IPCB_TCP_PACKET; + +#ifdef FXP_IP_CSUM_WAR + /* + * XXX The 82550 chip appears to have trouble + * dealing with IP header checksums in very small + * datagrams, namely fragments from 1 to 3 bytes + * in size. For example, say you want to transmit + * a UDP packet of 1473 bytes. The packet will be + * fragmented over two IP datagrams, the latter + * containing only one byte of data. The 82550 will + * botch the header checksum on the 1-byte fragment. + * As long as the datagram contains 4 or more bytes + * of data, you're ok. + * + * The following code attempts to work around this + * problem: if the datagram is less than 38 bytes + * in size (14 bytes ether header, 20 bytes IP header, + * plus 4 bytes of data), we punt and compute the IP + * header checksum by hand. This workaround doesn't + * work very well, however, since it can be fooled + * by things like VLAN tags and IP options that make + * the header sizes/offsets vary. + */ + + if (m->m_pkthdr.csum_flags & CSUM_IP) { + if (m->m_pkthdr.len < 38) { + struct ip *ip; + m->m_data += ETHER_HDR_LEN; + ip = mtod(m, struct ip *); + ip->ip_sum = in_cksum(m, ip->ip_hl << 2); + m->m_data -= ETHER_HDR_LEN; + m->m_pkthdr.csum_flags &= ~CSUM_IP; + } else { + txp->tx_cb->ipcb_ip_activation_high = + FXP_IPCB_HARDWAREPARSING_ENABLE; + txp->tx_cb->ipcb_ip_schedule |= + FXP_IPCB_IP_CHECKSUM_ENABLE; + } + } +#endif } error = bus_dmamap_load_mbuf_sg(sc->fxp_txmtag, txp->tx_map, *m_head, Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Mon Apr 26 17:57:08 2010 (r207235) +++ stable/8/sys/dev/msk/if_msk.c Mon Apr 26 18:02:12 2010 (r207236) @@ -2529,23 +2529,32 @@ msk_encap(struct msk_if_softc *sc_if, st ip = (struct ip *)(mtod(m, char *) + offset); offset += (ip->ip_hl << 2); tcp_offset = offset; - /* - * It seems that Yukon II has Tx checksum offload bug for - * small TCP packets that's less than 60 bytes in size - * (e.g. TCP window probe packet, pure ACK packet). - * Common work around like padding with zeros to make the - * frame minimum ethernet frame size didn't work at all. - * Instead of disabling checksum offload completely we - * resort to S/W checksum routine when we encounter short - * TCP frames. - * Short UDP packets appear to be handled correctly by - * Yukon II. Also I assume this bug does not happen on - * controllers that use newer descriptor format or - * automatic Tx checksum calaulcation. - */ - if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + m = m_pullup(m, offset + sizeof(struct tcphdr)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + tcp = (struct tcphdr *)(mtod(m, char *) + offset); + offset += (tcp->th_off << 2); + } else if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && (m->m_pkthdr.len < MSK_MIN_FRAMELEN) && (m->m_pkthdr.csum_flags & CSUM_TCP) != 0) { + /* + * It seems that Yukon II has Tx checksum offload bug + * for small TCP packets that's less than 60 bytes in + * size (e.g. TCP window probe packet, pure ACK packet). + * Common work around like padding with zeros to make + * the frame minimum ethernet frame size didn't work at + * all. + * Instead of disabling checksum offload completely we + * resort to S/W checksum routine when we encounter + * short TCP frames. + * Short UDP packets appear to be handled correctly by + * Yukon II. Also I assume this bug does not happen on + * controllers that use newer descriptor format or + * automatic Tx checksum calaulcation. + */ m = m_pullup(m, offset + sizeof(struct tcphdr)); if (m == NULL) { *m_head = NULL; @@ -2556,15 +2565,6 @@ msk_encap(struct msk_if_softc *sc_if, st m->m_pkthdr.len, offset); m->m_pkthdr.csum_flags &= ~CSUM_TCP; } - if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - m = m_pullup(m, offset + sizeof(struct tcphdr)); - if (m == NULL) { - *m_head = NULL; - return (ENOBUFS); - } - tcp = (struct tcphdr *)(mtod(m, char *) + offset); - offset += (tcp->th_off << 2); - } *m_head = m; } Modified: stable/8/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/8/sys/dev/nfe/if_nfe.c Mon Apr 26 17:57:08 2010 (r207235) +++ stable/8/sys/dev/nfe/if_nfe.c Mon Apr 26 18:02:12 2010 (r207236) @@ -2367,7 +2367,12 @@ nfe_encap(struct nfe_softc *sc, struct m m = *m_head; cflags = flags = 0; tso_segsz = 0; - if ((m->m_pkthdr.csum_flags & NFE_CSUM_FEATURES) != 0) { + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + tso_segsz = (uint32_t)m->m_pkthdr.tso_segsz << + NFE_TX_TSO_SHIFT; + cflags &= ~(NFE_TX_IP_CSUM | NFE_TX_TCP_UDP_CSUM); + cflags |= NFE_TX_TSO; + } else if ((m->m_pkthdr.csum_flags & NFE_CSUM_FEATURES) != 0) { if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) cflags |= NFE_TX_IP_CSUM; if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) @@ -2375,12 +2380,6 @@ nfe_encap(struct nfe_softc *sc, struct m if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) cflags |= NFE_TX_TCP_UDP_CSUM; } - if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - tso_segsz = (uint32_t)m->m_pkthdr.tso_segsz << - NFE_TX_TSO_SHIFT; - cflags &= ~(NFE_TX_IP_CSUM | NFE_TX_TCP_UDP_CSUM); - cflags |= NFE_TX_TSO; - } for (i = 0; i < nsegs; i++) { if (sc->nfe_flags & NFE_40BIT_ADDR) { From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 18:04:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B27F1065674; Mon, 26 Apr 2010 18:04:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 480AA8FC15; Mon, 26 Apr 2010 18:04: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 o3QI4YXw058896; Mon, 26 Apr 2010 18:04:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QI4Y3W058889; Mon, 26 Apr 2010 18:04:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261804.o3QI4Y3W058889@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 18:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207237 - in stable/7/sys/dev: age alc ale fxp msk nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 18:04:34 -0000 Author: yongari Date: Mon Apr 26 18:04:33 2010 New Revision: 207237 URL: http://svn.freebsd.org/changeset/base/207237 Log: MFC r206876: With r206844, CSUM_TCP is also set for CSUM_TSO case. Modify drivers to take into account for the change. Basically CSUM_TSO should be checked before checking CSUM_TCP. Modified: stable/7/sys/dev/age/if_age.c stable/7/sys/dev/alc/if_alc.c stable/7/sys/dev/ale/if_ale.c stable/7/sys/dev/fxp/if_fxp.c stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/nfe/if_nfe.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Mon Apr 26 18:02:12 2010 (r207236) +++ stable/7/sys/dev/age/if_age.c Mon Apr 26 18:04:33 2010 (r207237) @@ -1629,22 +1629,8 @@ age_encap(struct age_softc *sc, struct m } m = *m_head; - /* Configure Tx IP/TCP/UDP checksum offload. */ - if ((m->m_pkthdr.csum_flags & AGE_CSUM_FEATURES) != 0) { - cflags |= AGE_TD_CSUM; - if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) - cflags |= AGE_TD_TCPCSUM; - if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) - cflags |= AGE_TD_UDPCSUM; - /* Set checksum start offset. */ - cflags |= (poff << AGE_TD_CSUM_PLOADOFFSET_SHIFT); - /* Set checksum insertion position of TCP/UDP. */ - cflags |= ((poff + m->m_pkthdr.csum_data) << - AGE_TD_CSUM_XSUMOFFSET_SHIFT); - } - - /* Configure TSO. */ if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + /* Configure TSO. */ if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) { /* Not TSO but IP/TCP checksum offload. */ cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; @@ -1660,6 +1646,18 @@ age_encap(struct age_softc *sc, struct m /* Set IP/TCP header size. */ cflags |= ip->ip_hl << AGE_TD_IPHDR_LEN_SHIFT; cflags |= tcp->th_off << AGE_TD_TSO_TCPHDR_LEN_SHIFT; + } else if ((m->m_pkthdr.csum_flags & AGE_CSUM_FEATURES) != 0) { + /* Configure Tx IP/TCP/UDP checksum offload. */ + cflags |= AGE_TD_CSUM; + if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) + cflags |= AGE_TD_TCPCSUM; + if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) + cflags |= AGE_TD_UDPCSUM; + /* Set checksum start offset. */ + cflags |= (poff << AGE_TD_CSUM_PLOADOFFSET_SHIFT); + /* Set checksum insertion position of TCP/UDP. */ + cflags |= ((poff + m->m_pkthdr.csum_data) << + AGE_TD_CSUM_XSUMOFFSET_SHIFT); } /* Configure VLAN hardware tag insertion. */ Modified: stable/7/sys/dev/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Mon Apr 26 18:02:12 2010 (r207236) +++ stable/7/sys/dev/alc/if_alc.c Mon Apr 26 18:04:33 2010 (r207237) @@ -1908,28 +1908,7 @@ alc_encap(struct alc_softc *sc, struct m vtag = (vtag << TD_VLAN_SHIFT) & TD_VLAN_MASK; cflags |= TD_INS_VLAN_TAG; } - /* Configure Tx checksum offload. */ - if ((m->m_pkthdr.csum_flags & ALC_CSUM_FEATURES) != 0) { -#ifdef ALC_USE_CUSTOM_CSUM - cflags |= TD_CUSTOM_CSUM; - /* Set checksum start offset. */ - cflags |= ((poff >> 1) << TD_PLOAD_OFFSET_SHIFT) & - TD_PLOAD_OFFSET_MASK; - /* Set checksum insertion position of TCP/UDP. */ - cflags |= (((poff + m->m_pkthdr.csum_data) >> 1) << - TD_CUSTOM_CSUM_OFFSET_SHIFT) & TD_CUSTOM_CSUM_OFFSET_MASK; -#else - if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) - cflags |= TD_IPCSUM; - if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) - cflags |= TD_TCPCSUM; - if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) - cflags |= TD_UDPCSUM; - /* Set TCP/UDP header offset. */ - cflags |= (poff << TD_L4HDR_OFFSET_SHIFT) & - TD_L4HDR_OFFSET_MASK; -#endif - } else if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { /* Request TSO and set MSS. */ cflags |= TD_TSO | TD_TSO_DESCV1; cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << TD_MSS_SHIFT) & @@ -1961,6 +1940,27 @@ alc_encap(struct alc_softc *sc, struct m } /* Handle remaining fragments. */ idx = 1; + } else if ((m->m_pkthdr.csum_flags & ALC_CSUM_FEATURES) != 0) { + /* Configure Tx checksum offload. */ +#ifdef ALC_USE_CUSTOM_CSUM + cflags |= TD_CUSTOM_CSUM; + /* Set checksum start offset. */ + cflags |= ((poff >> 1) << TD_PLOAD_OFFSET_SHIFT) & + TD_PLOAD_OFFSET_MASK; + /* Set checksum insertion position of TCP/UDP. */ + cflags |= (((poff + m->m_pkthdr.csum_data) >> 1) << + TD_CUSTOM_CSUM_OFFSET_SHIFT) & TD_CUSTOM_CSUM_OFFSET_MASK; +#else + if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) + cflags |= TD_IPCSUM; + if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) + cflags |= TD_TCPCSUM; + if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) + cflags |= TD_UDPCSUM; + /* Set TCP/UDP header offset. */ + cflags |= (poff << TD_L4HDR_OFFSET_SHIFT) & + TD_L4HDR_OFFSET_MASK; +#endif } for (; idx < nsegs; idx++) { desc = &sc->alc_rdata.alc_tx_ring[prod]; Modified: stable/7/sys/dev/ale/if_ale.c ============================================================================== --- stable/7/sys/dev/ale/if_ale.c Mon Apr 26 18:02:12 2010 (r207236) +++ stable/7/sys/dev/ale/if_ale.c Mon Apr 26 18:04:33 2010 (r207237) @@ -1737,8 +1737,14 @@ ale_encap(struct ale_softc *sc, struct m bus_dmamap_sync(sc->ale_cdata.ale_tx_tag, map, BUS_DMASYNC_PREWRITE); m = *m_head; - /* Configure Tx checksum offload. */ - if ((m->m_pkthdr.csum_flags & ALE_CSUM_FEATURES) != 0) { + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + /* Request TSO and set MSS. */ + cflags |= ALE_TD_TSO; + cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << ALE_TD_MSS_SHIFT); + /* Set IP/TCP header size. */ + cflags |= ip->ip_hl << ALE_TD_IPHDR_LEN_SHIFT; + cflags |= tcp->th_off << ALE_TD_TCPHDR_LEN_SHIFT; + } else if ((m->m_pkthdr.csum_flags & ALE_CSUM_FEATURES) != 0) { /* * AR81xx supports Tx custom checksum offload feature * that offloads single 16bit checksum computation. @@ -1769,15 +1775,6 @@ ale_encap(struct ale_softc *sc, struct m ALE_TD_CSUM_XSUMOFFSET_SHIFT); } - if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - /* Request TSO and set MSS. */ - cflags |= ALE_TD_TSO; - cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << ALE_TD_MSS_SHIFT); - /* Set IP/TCP header size. */ - cflags |= ip->ip_hl << ALE_TD_IPHDR_LEN_SHIFT; - cflags |= tcp->th_off << ALE_TD_TCPHDR_LEN_SHIFT; - } - /* Configure VLAN hardware tag insertion. */ if ((m->m_flags & M_VLANTAG) != 0) { vtag = ALE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag); Modified: stable/7/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/7/sys/dev/fxp/if_fxp.c Mon Apr 26 18:02:12 2010 (r207236) +++ stable/7/sys/dev/fxp/if_fxp.c Mon Apr 26 18:04:33 2010 (r207237) @@ -1418,60 +1418,6 @@ fxp_encap(struct fxp_softc *sc, struct m FXP_IPCB_HARDWAREPARSING_ENABLE; m = *m_head; - /* - * Deal with TCP/IP checksum offload. Note that - * in order for TCP checksum offload to work, - * the pseudo header checksum must have already - * been computed and stored in the checksum field - * in the TCP header. The stack should have - * already done this for us. - */ - if (m->m_pkthdr.csum_flags & FXP_CSUM_FEATURES) { - txp->tx_cb->ipcb_ip_schedule = FXP_IPCB_TCPUDP_CHECKSUM_ENABLE; - if (m->m_pkthdr.csum_flags & CSUM_TCP) - txp->tx_cb->ipcb_ip_schedule |= FXP_IPCB_TCP_PACKET; - -#ifdef FXP_IP_CSUM_WAR - /* - * XXX The 82550 chip appears to have trouble - * dealing with IP header checksums in very small - * datagrams, namely fragments from 1 to 3 bytes - * in size. For example, say you want to transmit - * a UDP packet of 1473 bytes. The packet will be - * fragmented over two IP datagrams, the latter - * containing only one byte of data. The 82550 will - * botch the header checksum on the 1-byte fragment. - * As long as the datagram contains 4 or more bytes - * of data, you're ok. - * - * The following code attempts to work around this - * problem: if the datagram is less than 38 bytes - * in size (14 bytes ether header, 20 bytes IP header, - * plus 4 bytes of data), we punt and compute the IP - * header checksum by hand. This workaround doesn't - * work very well, however, since it can be fooled - * by things like VLAN tags and IP options that make - * the header sizes/offsets vary. - */ - - if (m->m_pkthdr.csum_flags & CSUM_IP) { - if (m->m_pkthdr.len < 38) { - struct ip *ip; - m->m_data += ETHER_HDR_LEN; - ip = mtod(m, struct ip *); - ip->ip_sum = in_cksum(m, ip->ip_hl << 2); - m->m_data -= ETHER_HDR_LEN; - m->m_pkthdr.csum_flags &= ~CSUM_IP; - } else { - txp->tx_cb->ipcb_ip_activation_high = - FXP_IPCB_HARDWAREPARSING_ENABLE; - txp->tx_cb->ipcb_ip_schedule |= - FXP_IPCB_IP_CHECKSUM_ENABLE; - } - } -#endif - } - if (m->m_pkthdr.csum_flags & CSUM_TSO) { /* * 82550/82551 requires ethernet/IP/TCP headers must be @@ -1540,6 +1486,58 @@ fxp_encap(struct fxp_softc *sc, struct m tcp_payload = m->m_pkthdr.len - ip_off - (ip->ip_hl << 2); tcp_payload -= tcp->th_off << 2; *m_head = m; + } else if (m->m_pkthdr.csum_flags & FXP_CSUM_FEATURES) { + /* + * Deal with TCP/IP checksum offload. Note that + * in order for TCP checksum offload to work, + * the pseudo header checksum must have already + * been computed and stored in the checksum field + * in the TCP header. The stack should have + * already done this for us. + */ + txp->tx_cb->ipcb_ip_schedule = FXP_IPCB_TCPUDP_CHECKSUM_ENABLE; + if (m->m_pkthdr.csum_flags & CSUM_TCP) + txp->tx_cb->ipcb_ip_schedule |= FXP_IPCB_TCP_PACKET; + +#ifdef FXP_IP_CSUM_WAR + /* + * XXX The 82550 chip appears to have trouble + * dealing with IP header checksums in very small + * datagrams, namely fragments from 1 to 3 bytes + * in size. For example, say you want to transmit + * a UDP packet of 1473 bytes. The packet will be + * fragmented over two IP datagrams, the latter + * containing only one byte of data. The 82550 will + * botch the header checksum on the 1-byte fragment. + * As long as the datagram contains 4 or more bytes + * of data, you're ok. + * + * The following code attempts to work around this + * problem: if the datagram is less than 38 bytes + * in size (14 bytes ether header, 20 bytes IP header, + * plus 4 bytes of data), we punt and compute the IP + * header checksum by hand. This workaround doesn't + * work very well, however, since it can be fooled + * by things like VLAN tags and IP options that make + * the header sizes/offsets vary. + */ + + if (m->m_pkthdr.csum_flags & CSUM_IP) { + if (m->m_pkthdr.len < 38) { + struct ip *ip; + m->m_data += ETHER_HDR_LEN; + ip = mtod(m, struct ip *); + ip->ip_sum = in_cksum(m, ip->ip_hl << 2); + m->m_data -= ETHER_HDR_LEN; + m->m_pkthdr.csum_flags &= ~CSUM_IP; + } else { + txp->tx_cb->ipcb_ip_activation_high = + FXP_IPCB_HARDWAREPARSING_ENABLE; + txp->tx_cb->ipcb_ip_schedule |= + FXP_IPCB_IP_CHECKSUM_ENABLE; + } + } +#endif } error = bus_dmamap_load_mbuf_sg(sc->fxp_txmtag, txp->tx_map, *m_head, Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Mon Apr 26 18:02:12 2010 (r207236) +++ stable/7/sys/dev/msk/if_msk.c Mon Apr 26 18:04:33 2010 (r207237) @@ -2529,23 +2529,32 @@ msk_encap(struct msk_if_softc *sc_if, st ip = (struct ip *)(mtod(m, char *) + offset); offset += (ip->ip_hl << 2); tcp_offset = offset; - /* - * It seems that Yukon II has Tx checksum offload bug for - * small TCP packets that's less than 60 bytes in size - * (e.g. TCP window probe packet, pure ACK packet). - * Common work around like padding with zeros to make the - * frame minimum ethernet frame size didn't work at all. - * Instead of disabling checksum offload completely we - * resort to S/W checksum routine when we encounter short - * TCP frames. - * Short UDP packets appear to be handled correctly by - * Yukon II. Also I assume this bug does not happen on - * controllers that use newer descriptor format or - * automatic Tx checksum calaulcation. - */ - if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + m = m_pullup(m, offset + sizeof(struct tcphdr)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + tcp = (struct tcphdr *)(mtod(m, char *) + offset); + offset += (tcp->th_off << 2); + } else if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && (m->m_pkthdr.len < MSK_MIN_FRAMELEN) && (m->m_pkthdr.csum_flags & CSUM_TCP) != 0) { + /* + * It seems that Yukon II has Tx checksum offload bug + * for small TCP packets that's less than 60 bytes in + * size (e.g. TCP window probe packet, pure ACK packet). + * Common work around like padding with zeros to make + * the frame minimum ethernet frame size didn't work at + * all. + * Instead of disabling checksum offload completely we + * resort to S/W checksum routine when we encounter + * short TCP frames. + * Short UDP packets appear to be handled correctly by + * Yukon II. Also I assume this bug does not happen on + * controllers that use newer descriptor format or + * automatic Tx checksum calaulcation. + */ m = m_pullup(m, offset + sizeof(struct tcphdr)); if (m == NULL) { *m_head = NULL; @@ -2556,15 +2565,6 @@ msk_encap(struct msk_if_softc *sc_if, st m->m_pkthdr.len, offset); m->m_pkthdr.csum_flags &= ~CSUM_TCP; } - if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - m = m_pullup(m, offset + sizeof(struct tcphdr)); - if (m == NULL) { - *m_head = NULL; - return (ENOBUFS); - } - tcp = (struct tcphdr *)(mtod(m, char *) + offset); - offset += (tcp->th_off << 2); - } *m_head = m; } Modified: stable/7/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/7/sys/dev/nfe/if_nfe.c Mon Apr 26 18:02:12 2010 (r207236) +++ stable/7/sys/dev/nfe/if_nfe.c Mon Apr 26 18:04:33 2010 (r207237) @@ -2357,7 +2357,12 @@ nfe_encap(struct nfe_softc *sc, struct m m = *m_head; cflags = flags = 0; tso_segsz = 0; - if ((m->m_pkthdr.csum_flags & NFE_CSUM_FEATURES) != 0) { + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + tso_segsz = (uint32_t)m->m_pkthdr.tso_segsz << + NFE_TX_TSO_SHIFT; + cflags &= ~(NFE_TX_IP_CSUM | NFE_TX_TCP_UDP_CSUM); + cflags |= NFE_TX_TSO; + } else if ((m->m_pkthdr.csum_flags & NFE_CSUM_FEATURES) != 0) { if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) cflags |= NFE_TX_IP_CSUM; if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) @@ -2365,12 +2370,6 @@ nfe_encap(struct nfe_softc *sc, struct m if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) cflags |= NFE_TX_TCP_UDP_CSUM; } - if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - tso_segsz = (uint32_t)m->m_pkthdr.tso_segsz << - NFE_TX_TSO_SHIFT; - cflags &= ~(NFE_TX_IP_CSUM | NFE_TX_TCP_UDP_CSUM); - cflags |= NFE_TX_TSO; - } for (i = 0; i < nsegs; i++) { if (sc->nfe_flags & NFE_40BIT_ADDR) { From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 18:07:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55A491065672; Mon, 26 Apr 2010 18:07:56 +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 43C518FC14; Mon, 26 Apr 2010 18:07: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 o3QI7uFW059665; Mon, 26 Apr 2010 18:07:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QI7u6M059663; Mon, 26 Apr 2010 18:07:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261807.o3QI7u6M059663@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 18:07:56 +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: r207238 - stable/8/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 18:07:56 -0000 Author: yongari Date: Mon Apr 26 18:07:55 2010 New Revision: 207238 URL: http://svn.freebsd.org/changeset/base/207238 Log: MFC r207071: Intialize interrupt moderation control register. The magic value was chosen by lots of trial and errors. The chosen value shows good interrupt moderation without additional latency. Without this change, controller can generate more than 140k interrupts per second under high network load. Submitted by: xclin cs dot nctu dot edu dot tw > Modified: stable/8/sys/dev/sge/if_sge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/sge/if_sge.c ============================================================================== --- stable/8/sys/dev/sge/if_sge.c Mon Apr 26 18:04:33 2010 (r207237) +++ stable/8/sys/dev/sge/if_sge.c Mon Apr 26 18:07:55 2010 (r207238) @@ -1551,10 +1551,13 @@ sge_init_locked(struct sge_softc *sc) /* * XXX Try to mitigate interrupts. */ + CSR_WRITE_4(sc, IntrControl, 0x08880000); +#ifdef notyet if (sc->sge_intrcontrol != 0) CSR_WRITE_4(sc, IntrControl, sc->sge_intrcontrol); if (sc->sge_intrtimer != 0) CSR_WRITE_4(sc, IntrTimer, sc->sge_intrtimer); +#endif /* * Clear and enable interrupts. From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 18:09:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 524F0106566C; Mon, 26 Apr 2010 18:09:13 +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 4092B8FC1E; Mon, 26 Apr 2010 18:09: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 o3QI9DCk060024; Mon, 26 Apr 2010 18:09:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QI9Dub060022; Mon, 26 Apr 2010 18:09:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004261809.o3QI9Dub060022@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 18:09: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: r207239 - stable/7/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 18:09:13 -0000 Author: yongari Date: Mon Apr 26 18:09:12 2010 New Revision: 207239 URL: http://svn.freebsd.org/changeset/base/207239 Log: MFC r207071: Intialize interrupt moderation control register. The magic value was chosen by lots of trial and errors. The chosen value shows good interrupt moderation without additional latency. Without this change, controller can generate more than 140k interrupts per second under high network load. Submitted by: xclin cs dot nctu dot edu dot tw > Modified: stable/7/sys/dev/sge/if_sge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sge/if_sge.c ============================================================================== --- stable/7/sys/dev/sge/if_sge.c Mon Apr 26 18:07:55 2010 (r207238) +++ stable/7/sys/dev/sge/if_sge.c Mon Apr 26 18:09:12 2010 (r207239) @@ -1551,10 +1551,13 @@ sge_init_locked(struct sge_softc *sc) /* * XXX Try to mitigate interrupts. */ + CSR_WRITE_4(sc, IntrControl, 0x08880000); +#ifdef notyet if (sc->sge_intrcontrol != 0) CSR_WRITE_4(sc, IntrControl, sc->sge_intrcontrol); if (sc->sge_intrtimer != 0) CSR_WRITE_4(sc, IntrTimer, sc->sge_intrtimer); +#endif /* * Clear and enable interrupts. From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 18:44:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B5991065670; Mon, 26 Apr 2010 18:44:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E669A8FC13; Mon, 26 Apr 2010 18:44: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 o3QIiUMO068092; Mon, 26 Apr 2010 18:44:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QIiUxG068090; Mon, 26 Apr 2010 18:44:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004261844.o3QIiUxG068090@svn.freebsd.org> From: Marius Strobl Date: Mon, 26 Apr 2010 18:44: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: r207240 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 18:44:31 -0000 Author: marius Date: Mon Apr 26 18:44:30 2010 New Revision: 207240 URL: http://svn.freebsd.org/changeset/base/207240 Log: Skip the pseudo-devices found in Fujitsu Siemens PRIMEPOWER250. Modified: head/sys/sparc64/sparc64/nexus.c Modified: head/sys/sparc64/sparc64/nexus.c ============================================================================== --- head/sys/sparc64/sparc64/nexus.c Mon Apr 26 18:09:12 2010 (r207239) +++ head/sys/sparc64/sparc64/nexus.c Mon Apr 26 18:44:30 2010 (r207240) @@ -153,6 +153,7 @@ EARLY_DRIVER_MODULE(nexus, root, nexus_d MODULE_VERSION(nexus, 1); static const char *const nexus_excl_name[] = { + "FJSV,system", "aliases", "associations", "chosen", @@ -163,6 +164,7 @@ static const char *const nexus_excl_name "openprom", "options", "packages", + "physical-memory", "rsc", "sgcn", "todsg", From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 18:49:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89F56106564A; Mon, 26 Apr 2010 18:49:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78BEE8FC0A; Mon, 26 Apr 2010 18:49: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 o3QIn66N069151; Mon, 26 Apr 2010 18:49:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QIn69l069149; Mon, 26 Apr 2010 18:49:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004261849.o3QIn69l069149@svn.freebsd.org> From: Marius Strobl Date: Mon, 26 Apr 2010 18:49: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: r207241 - head/sys/sparc64/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 18:49:06 -0000 Author: marius Date: Mon Apr 26 18:49:06 2010 New Revision: 207241 URL: http://svn.freebsd.org/changeset/base/207241 Log: - Add a missing const. - Map the NS16550 found in Fujitsu Siemens PRIMEPOWER250 to PNP0501 as well. Modified: head/sys/sparc64/isa/isa.c Modified: head/sys/sparc64/isa/isa.c ============================================================================== --- head/sys/sparc64/isa/isa.c Mon Apr 26 18:44:30 2010 (r207240) +++ head/sys/sparc64/isa/isa.c Mon Apr 26 18:49:06 2010 (r207241) @@ -116,7 +116,7 @@ isa_init(device_t dev) } static const struct { - const char *name; + const char *const name; uint32_t id; } const ofw_isa_pnp_map[] = { { "SUNW,lomh", 0x0000ae4e }, /* SUN0000 */ @@ -126,6 +126,7 @@ static const struct { { "flashprom", 0x0100ae4e }, /* SUN0001 */ { "parallel", 0x0104d041 }, /* PNP0401 */ { "serial", 0x0105d041 }, /* PNP0501 */ + { "su", 0x0105d041 }, /* PNP0501 */ { "i2c", 0x0200ae4e }, /* SUN0002 */ { "rmc-comm", 0x0300ae4e }, /* SUN0003 */ { "kb_ps2", 0x0303d041 }, /* PNP0303 */ From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 18:56:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4641106564A; Mon, 26 Apr 2010 18:56:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 933188FC17; Mon, 26 Apr 2010 18:56: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 o3QIu6QE070851; Mon, 26 Apr 2010 18:56:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QIu6PQ070849; Mon, 26 Apr 2010 18:56:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004261856.o3QIu6PQ070849@svn.freebsd.org> From: Marius Strobl Date: Mon, 26 Apr 2010 18:56: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: r207242 - 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: Mon, 26 Apr 2010 18:56:06 -0000 Author: marius Date: Mon Apr 26 18:56:06 2010 New Revision: 207242 URL: http://svn.freebsd.org/changeset/base/207242 Log: For the on-board interfaces found in Fujitsu SPARC64 machines obtain the MAC address via OFW as well. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Apr 26 18:49:06 2010 (r207241) +++ head/sys/dev/bge/if_bge.c Mon Apr 26 18:56:06 2010 (r207242) @@ -519,7 +519,7 @@ bge_has_eaddr(struct bge_softc *sc) */ if (OF_getprop(ofw_bus_get_node(dev), SPARC64_OFW_SUBVENDOR, &subvendor, sizeof(subvendor)) == sizeof(subvendor) && - subvendor == SUN_VENDORID) + (subvendor == FJTSU_VENDORID || subvendor == SUN_VENDORID)) return (0); memset(buf, 0, sizeof(buf)); if (OF_package_to_path(ofw_bus_get_node(dev), buf, sizeof(buf)) > 0) { From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 19:13:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BAB7106566C; Mon, 26 Apr 2010 19:13:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4C2E8FC12; Mon, 26 Apr 2010 19:13: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 o3QJDAj2074649; Mon, 26 Apr 2010 19:13:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QJDAcp074648; Mon, 26 Apr 2010 19:13:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004261913.o3QJDAcp074648@svn.freebsd.org> From: Marius Strobl Date: Mon, 26 Apr 2010 19:13: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: r207243 - in head/sys: sparc64/include sparc64/sparc64 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: Mon, 26 Apr 2010 19:13:11 -0000 Author: marius Date: Mon Apr 26 19:13:10 2010 New Revision: 207243 URL: http://svn.freebsd.org/changeset/base/207243 Log: Add OF_getscsinitid(), a helper similar to OF_getetheraddr() but for obtaining the initiator ID to be used for SPI controllers from the Open Firmware device tree. Modified: head/sys/sparc64/include/ofw_machdep.h head/sys/sparc64/sparc64/ofw_machdep.c head/sys/sun4v/include/ofw_machdep.h Modified: head/sys/sparc64/include/ofw_machdep.h ============================================================================== --- head/sys/sparc64/include/ofw_machdep.h Mon Apr 26 18:56:06 2010 (r207242) +++ head/sys/sparc64/include/ofw_machdep.h Mon Apr 26 19:13:10 2010 (r207243) @@ -36,6 +36,7 @@ typedef uint64_t cell_t; int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); +u_int OF_getscsinitid(device_t); void cpu_shutdown(void *); int ofw_entry(void *); void ofw_exit(void *); Modified: head/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/ofw_machdep.c Mon Apr 26 18:56:06 2010 (r207242) +++ head/sys/sparc64/sparc64/ofw_machdep.c Mon Apr 26 19:13:10 2010 (r207243) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2001 by Thomas Moestl . - * Copyright (c) 2005 - 2009 by Marius Strobl . + * Copyright (c) 2005 - 2010 by Marius Strobl . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,6 +68,19 @@ OF_getetheraddr(device_t dev, u_char *ad bcopy(&idp.id_ether, addr, ETHER_ADDR_LEN); } +u_int +OF_getscsinitid(device_t dev) +{ + phandle_t node; + uint32_t id; + + for (node = ofw_bus_get_node(dev); node != 0; node = OF_parent(node)) + if (OF_getprop(node, "scsi-initiator-id", &id, + sizeof(id)) > 0) + return (id); + return (7); +} + static __inline uint32_t phys_hi_mask_space(const char *bus, uint32_t phys_hi) { Modified: head/sys/sun4v/include/ofw_machdep.h ============================================================================== --- head/sys/sun4v/include/ofw_machdep.h Mon Apr 26 18:56:06 2010 (r207242) +++ head/sys/sun4v/include/ofw_machdep.h Mon Apr 26 19:13:10 2010 (r207243) @@ -36,6 +36,7 @@ typedef uint64_t cell_t; int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); +u_int OF_getscsinitid(device_t); void cpu_shutdown(void *); int ofw_entry(void *); void ofw_exit(void *); From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 19:19:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D06341065670; Mon, 26 Apr 2010 19:19:29 +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 BE4678FC0A; Mon, 26 Apr 2010 19:19:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3QJJTP5076186; Mon, 26 Apr 2010 19:19:29 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QJJTo4076184; Mon, 26 Apr 2010 19:19:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201004261919.o3QJJTo4076184@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 26 Apr 2010 19:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207245 - stable/8/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 19:19:30 -0000 Author: jkim Date: Mon Apr 26 19:19:29 2010 New Revision: 207245 URL: http://svn.freebsd.org/changeset/base/207245 Log: MFC: r206384 Allocate memory for VBE info block with malloc(9), not as static local. Modified: stable/8/sys/dev/fb/vesa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/fb/vesa.c ============================================================================== --- stable/8/sys/dev/fb/vesa.c Mon Apr 26 19:19:01 2010 (r207244) +++ stable/8/sys/dev/fb/vesa.c Mon Apr 26 19:19:29 2010 (r207245) @@ -763,8 +763,8 @@ vesa_get_bpscanline(struct vesa_mode *vm static int vesa_bios_init(void) { - static struct vesa_info buf; struct vesa_mode vmode; + struct vesa_info *buf; video_info_t *p; x86regs_t regs; size_t bsize; @@ -800,7 +800,7 @@ vesa_bios_init(void) x86bios_init_regs(®s); regs.R_AX = 0x4f00; - vmbuf = x86bios_alloc(&offs, sizeof(buf)); + vmbuf = x86bios_alloc(&offs, sizeof(*buf)); if (vmbuf == NULL) return (1); @@ -813,23 +813,23 @@ vesa_bios_init(void) if (regs.R_AX != 0x004f || bcmp("VESA", vmbuf, 4) != 0) goto fail; - bcopy(vmbuf, &buf, sizeof(buf)); + vesa_adp_info = buf = malloc(sizeof(*buf), M_DEVBUF, M_WAITOK); + bcopy(vmbuf, buf, sizeof(*buf)); - vesa_adp_info = &buf; if (bootverbose) { printf("VESA: information block\n"); - hexdump(&buf, sizeof(buf), NULL, HD_OMIT_CHARS); + hexdump(buf, sizeof(*buf), NULL, HD_OMIT_CHARS); } - vers = buf.v_version = le16toh(buf.v_version); - buf.v_oemstr = le32toh(buf.v_oemstr); - buf.v_flags = le32toh(buf.v_flags); - buf.v_modetable = le32toh(buf.v_modetable); - buf.v_memsize = le16toh(buf.v_memsize); - buf.v_revision = le16toh(buf.v_revision); - buf.v_venderstr = le32toh(buf.v_venderstr); - buf.v_prodstr = le32toh(buf.v_prodstr); - buf.v_revstr = le32toh(buf.v_revstr); + vers = buf->v_version = le16toh(buf->v_version); + buf->v_oemstr = le32toh(buf->v_oemstr); + buf->v_flags = le32toh(buf->v_flags); + buf->v_modetable = le32toh(buf->v_modetable); + buf->v_memsize = le16toh(buf->v_memsize); + buf->v_revision = le16toh(buf->v_revision); + buf->v_venderstr = le32toh(buf->v_venderstr); + buf->v_prodstr = le32toh(buf->v_prodstr); + buf->v_revstr = le32toh(buf->v_revstr); if (vers < 0x0102) { printf("VESA: VBE version %d.%d is not supported; " @@ -839,21 +839,21 @@ vesa_bios_init(void) return (1); } - VESA_STRCPY(vesa_oemstr, buf.v_oemstr); + VESA_STRCPY(vesa_oemstr, buf->v_oemstr); if (vers >= 0x0200) { - VESA_STRCPY(vesa_venderstr, buf.v_venderstr); - VESA_STRCPY(vesa_prodstr, buf.v_prodstr); - VESA_STRCPY(vesa_revstr, buf.v_revstr); + VESA_STRCPY(vesa_venderstr, buf->v_venderstr); + VESA_STRCPY(vesa_prodstr, buf->v_prodstr); + VESA_STRCPY(vesa_revstr, buf->v_revstr); } is_via_cle266 = strncmp(vesa_oemstr, VESA_VIA_CLE266, sizeof(VESA_VIA_CLE266)) == 0; - if (buf.v_modetable == 0) + if (buf->v_modetable == 0) goto fail; - msize = (size_t)buf.v_memsize * 64 * 1024; + msize = (size_t)buf->v_memsize * 64 * 1024; - vesa_vmodetab = x86bios_offset(BIOS_SADDRTOLADDR(buf.v_modetable)); + vesa_vmodetab = x86bios_offset(BIOS_SADDRTOLADDR(buf->v_modetable)); for (i = 0, modes = 0; (i < (M_VESA_MODE_MAX - M_VESA_BASE + 1)) && (vesa_vmodetab[i] != 0xffff); ++i) { @@ -1016,12 +1016,16 @@ vesa_bios_init(void) if (!has_vesa_bios) goto fail; - x86bios_free(vmbuf, sizeof(buf)); + x86bios_free(vmbuf, sizeof(*buf)); return (0); fail: if (vmbuf != NULL) x86bios_free(vmbuf, sizeof(buf)); + if (vesa_adp_info != NULL) { + free(vesa_adp_info, M_DEVBUF); + vesa_adp_info = NULL; + } if (vesa_oemstr != NULL) { free(vesa_oemstr, M_DEVBUF); vesa_oemstr = NULL; @@ -1875,6 +1879,8 @@ vesa_unload(void) } splx(s); + if (vesa_adp_info != NULL) + free(vesa_adp_info, M_DEVBUF); if (vesa_oemstr != NULL) free(vesa_oemstr, M_DEVBUF); if (vesa_venderstr != NULL) From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 20:05:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12097106564A; Mon, 26 Apr 2010 20:05:49 +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 DB8D08FC15; Mon, 26 Apr 2010 20:05:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3QK5mnq086782; Mon, 26 Apr 2010 20:05:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QK5mUK086780; Mon, 26 Apr 2010 20:05:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004262005.o3QK5mUK086780@svn.freebsd.org> From: Xin LI Date: Mon, 26 Apr 2010 20:05: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: r207247 - head/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 20:05:49 -0000 Author: delphij Date: Mon Apr 26 20:05:48 2010 New Revision: 207247 URL: http://svn.freebsd.org/changeset/base/207247 Log: Add a signal handler for SIGINT which removes output file when necessary. While I'm there, move unlink_input() slightly down to after closing the output file, in uncompression path. MFC after: 2 weeks Modified: head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Mon Apr 26 20:01:52 2010 (r207246) +++ head/usr.bin/gzip/gzip.c Mon Apr 26 20:05:48 2010 (r207247) @@ -43,7 +43,6 @@ __RCSID("$FreeBSD$"); * * TODO: * - use mmap where possible - * - handle some signals better (remove outfile?) * - make bzip2/compress -v/-t/-l support work as well as possible */ @@ -194,6 +193,7 @@ static int qflag; /* quiet mode */ static int rflag; /* recursive mode */ static int tflag; /* test */ static int vflag; /* verbose mode */ +static const char *remove_file = NULL; /* file to be removed upon SIGINT */ #else #define qflag 0 #define tflag 0 @@ -231,6 +231,7 @@ static void usage(void); static void display_version(void); #ifndef SMALL static void display_license(void); +static void sigint_handler(int); #endif static const suffixes_t *check_suffix(char *, int); static ssize_t read_retry(int, void *, size_t); @@ -300,11 +301,10 @@ main(int argc, char **argv) #endif int ch; - /* XXX set up signals */ - #ifndef SMALL if ((gzip = getenv("GZIP")) != NULL) prepend_gzip(gzip, &argc, &argv); + signal(SIGINT, sigint_handler); #endif /* @@ -1171,6 +1171,15 @@ unlink_input(const char *file, const str return; unlink(file); } + +static void +sigint_handler(int signo __unused) +{ + + if (remove_file != NULL) + unlink(remove_file); + exit(2); +} #endif static const suffixes_t * @@ -1257,6 +1266,9 @@ file_compress(char *file, char *outfile, fclose(stdin); return -1; } +#ifndef SMALL + remove_file = outfile; +#endif } else out = STDOUT_FILENO; @@ -1288,6 +1300,7 @@ file_compress(char *file, char *outfile, } copymodes(out, &isb, outfile); + remove_file = NULL; #endif if (close(out) == -1) maybe_warn("couldn't close output"); @@ -1424,6 +1437,9 @@ file_uncompress(char *file, char *outfil maybe_warn("can't open %s", outfile); goto lose; } +#ifndef SMALL + remove_file = outfile; +#endif } else zfd = STDOUT_FILENO; @@ -1555,11 +1571,12 @@ file_uncompress(char *file, char *outfil unlink(outfile); return -1; } - unlink_input(file, &isb); #ifndef SMALL copymodes(ofd, &isb, outfile); + remove_file = NULL; #endif close(ofd); + unlink_input(file, &isb); return size; unexpected_EOF: From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 20:19:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E8CE1065670; Mon, 26 Apr 2010 20:19:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C92D8FC17; Mon, 26 Apr 2010 20:19: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 o3QKJo2n089974; Mon, 26 Apr 2010 20:19:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QKJnNO089968; Mon, 26 Apr 2010 20:19:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004262019.o3QKJnNO089968@svn.freebsd.org> From: Marius Strobl Date: Mon, 26 Apr 2010 20:19: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: r207248 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 20:19:50 -0000 Author: marius Date: Mon Apr 26 20:19:49 2010 New Revision: 207248 URL: http://svn.freebsd.org/changeset/base/207248 Log: Don't bother enabling interrupts before we're ready to handle them. This prevents the firmware of Fujitsu Siemens PRIMEPOWER250, which both causes stray interrupts and erroneously enables interrupts at least when calling SUNW,set-trap-table, in the foot. Modified: head/sys/sparc64/sparc64/cheetah.c head/sys/sparc64/sparc64/locore.S head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/mp_locore.S head/sys/sparc64/sparc64/mp_machdep.c Modified: head/sys/sparc64/sparc64/cheetah.c ============================================================================== --- head/sys/sparc64/sparc64/cheetah.c Mon Apr 26 20:05:48 2010 (r207247) +++ head/sys/sparc64/sparc64/cheetah.c Mon Apr 26 20:19:49 2010 (r207248) @@ -58,13 +58,6 @@ void cheetah_init(u_int cpu_impl) { u_long val; - register_t s; - - /* - * Disable interrupts for safety, this shouldn't be actually - * necessary though. - */ - s = intr_disable(); /* Ensure the TSB Extension Registers hold 0 as TSB_Base. */ @@ -134,8 +127,6 @@ cheetah_init(u_int cpu_impl) val &= ~DCR_DTPE; } wr(asr18, val, 0); - - intr_restore(s); } /* Modified: head/sys/sparc64/sparc64/locore.S ============================================================================== --- head/sys/sparc64/sparc64/locore.S Mon Apr 26 20:05:48 2010 (r207247) +++ head/sys/sparc64/sparc64/locore.S Mon Apr 26 20:19:49 2010 (r207248) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -47,7 +48,7 @@ ENTRY(btext) ENTRY(_start) /* * Initialize misc. state to known values: interrupts disabled, normal - * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL_TICK and * floating point disabled. * Note that some firmware versions don't implement a clean window * trap handler so we unfortunately can't clear the windows by setting @@ -55,7 +56,7 @@ ENTRY(_start) */ wrpr %g0, PSTATE_NORMAL, %pstate flushw - wrpr %g0, 0, %pil + wrpr %g0, PIL_TICK, %pil wr %g0, 0, %fprs /* @@ -66,11 +67,6 @@ ENTRY(_start) sub %l0, SPOFF + CCFSZ, %sp /* - * Enable interrupts. - */ - wrpr %g0, PSTATE_KERNEL, %pstate - - /* * Do initial bootstrap to setup pmap and thread0. */ call sparc64_init @@ -97,7 +93,7 @@ ENTRY(cpu_setregs) ldx [%o0 + PC_CURPCB], %o1 /* - * Disable interrupts, normal globals. + * Ensure we are on normal globals. */ wrpr %g0, PSTATE_NORMAL, %pstate @@ -147,11 +143,6 @@ ENTRY(cpu_setregs) wrpr %o1, 0, %tba stw %o3, [%o2] - /* - * Re-enable interrupts. - */ - wrpr %g0, PSTATE_KERNEL, %pstate - retl nop END(cpu_setregs) Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Mon Apr 26 20:05:48 2010 (r207247) +++ head/sys/sparc64/sparc64/machdep.c Mon Apr 26 20:19:49 2010 (r207248) @@ -341,7 +341,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l cpu_impl = VER_IMPL(rdpr(ver)); /* - * Do CPU-specific Initialization. + * Do CPU-specific initialization. */ if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(cpu_impl); @@ -477,6 +477,10 @@ sparc64_init(caddr_t mdp, u_long o1, u_l sizeof(itlb_slots)) == -1) panic("sparc64_init: cannot determine number of iTLB slots"); + /* + * Initialize and enable the caches. Note that his may include + * applying workarounds. + */ cache_init(pc); cache_enable(cpu_impl); uma_set_align(pc->pc_cache.dc_linesize - 1); @@ -568,8 +572,18 @@ sparc64_init(caddr_t mdp, u_long o1, u_l dpcpu_init(dpcpu0, 0); msgbufinit(msgbufp, MSGBUF_SIZE); + /* + * Initialize mutexes. + */ mutex_init(); + + /* + * Finish the interrupt initialization now that mutexes work and + * enable them. + */ intr_init2(); + wrpr(pil, 0, PIL_TICK); + wrpr(pstate, 0, PSTATE_KERNEL); /* * Finish pmap initialization now that we're ready for mutexes. Modified: head/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- head/sys/sparc64/sparc64/mp_locore.S Mon Apr 26 20:05:48 2010 (r207247) +++ head/sys/sparc64/sparc64/mp_locore.S Mon Apr 26 20:19:49 2010 (r207248) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -44,14 +45,14 @@ __FBSDID("$FreeBSD$"); _ALIGN_TEXT /* * Initialize misc. state to known values: interrupts disabled, normal - * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL_TICK and * floating point disabled. * Note that some firmware versions don't implement a clean window * trap handler so we unfortunately can't clear the windows by setting * %cleanwin to zero here. */ 1: wrpr %g0, PSTATE_NORMAL, %pstate - wrpr %g0, 0, %pil + wrpr %g0, PIL_TICK, %pil wr %g0, 0, %fprs rdpr %ver, %l7 @@ -262,11 +263,6 @@ ENTRY(mp_startup) add %l1, %l2, %l1 sub %l1, SPOFF + CCFSZ, %sp - /* - * Enable interrupts. - */ - wrpr %g0, PSTATE_KERNEL, %pstate - #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Mon Apr 26 20:05:48 2010 (r207247) +++ head/sys/sparc64/sparc64/mp_machdep.c Mon Apr 26 20:19:49 2010 (r207248) @@ -409,16 +409,32 @@ cpu_mp_bootstrap(struct pcpu *pc) volatile struct cpu_start_args *csa; csa = &cpu_start_args; + + /* Do CPU-specific initialization. */ if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(pc->pc_impl); + /* + * Enable the caches. Note that his may include applying workarounds. + */ cache_enable(pc->pc_impl); + + /* Lock the kernel TSB in the TLB. */ pmap_map_tsb(); + /* * Flush all non-locked TLB entries possibly left over by the * firmware. */ tlb_flush_nonlocked(); + + /* Initialize global registers. */ cpu_setregs(pc); + + /* Enable interrupts. */ + wrpr(pil, 0, PIL_TICK); + wrpr(pstate, 0, PSTATE_KERNEL); + + /* Start the (S)TICK interrupts. */ tick_start(); smp_cpus++; From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 20:42:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49A35106566C; Mon, 26 Apr 2010 20:42:23 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-relay3.uni-muenster.de (ZIVM-RELAY3.UNI-MUENSTER.DE [128.176.192.19]) by mx1.freebsd.org (Postfix) with ESMTP id 0CF208FC1F; Mon, 26 Apr 2010 20:42:21 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.52,275,1270418400"; d="txt'?scan'208";a="32355961" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 26 Apr 2010 22:42:21 +0200 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 4C0541B0769; Mon, 26 Apr 2010 22:42:21 +0200 (CEST) Date: Mon, 26 Apr 2010 22:42:14 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Xin LI Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=+permail-20100426204214f0889e8400004a8c-a_best01+ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r207247 - head/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 20:42:23 -0000 This is a MIME encoded multipart message. --+permail-20100426204214f0889e8400004a8c-a_best01+ Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit while you're at it could you correct this typo? thanks. -- Alexander Best --+permail-20100426204214f0889e8400004a8c-a_best01+ Content-Type: text/plain Content-Transfer-Encoding: Base64 Content-Disposition: attachment; filename="gzip.1.patch.txt" SW5kZXg6IHVzci5iaW4vZ3ppcC9nemlwLjEKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gdXNyLmJpbi9nemlwL2d6 aXAuMQkocmV2aXNpb24gMjA3MTg1KQorKysgdXNyLmJpbi9nemlwL2d6aXAuMQkod29ya2luZyBj b3B5KQpAQCAtMjE4LDcgKzIxOCw3IEBACiAuQW4gWGluIExJIEFxIGRlbHBoaWpARnJlZUJTRC5v cmcgLgogLlNoIEJVR1MKIEFjY29yZGluZyB0byBSRkMgMTk1MiwgdGhlIHJlY29yZGVkIGZpbGUg c2l6ZSBpcyBzdG9yZWQgaW4gYSAzMi1iaXQKLWludGVnZXIgYW5kIHRoZXJlZm9yZSBpdCBjYW4g bm90IHJlcHJlc2VudCBmaWxlcyB0aGF0IGlzIGJpZ2dlciB0aGFuCitpbnRlZ2VyIGFuZCB0aGVy ZWZvcmUgaXQgY2FuIG5vdCByZXByZXNlbnQgZmlsZXMgdGhhdCBhcmUgYmlnZ2VyIHRoYW4KIDRH QiBpbiBzaXplLiAgVGhpcyBsaW1pdGF0aW9uIGFsc28gYXBwbGllcyB0bwogLkZsIGwKIG9wdGlv biBvZgo= --+permail-20100426204214f0889e8400004a8c-a_best01+-- From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 20:55:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36CE01065670; Mon, 26 Apr 2010 20:55:04 +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 207DE8FC0A; Mon, 26 Apr 2010 20:55: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 o3QKt4pE097876; Mon, 26 Apr 2010 20:55:04 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QKt3eD097863; Mon, 26 Apr 2010 20:55:03 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201004262055.o3QKt3eD097863@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 26 Apr 2010 20:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207250 - in stable/8: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/dispatcher sy... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Apr 2010 20:55:04 -0000 Author: jkim Date: Mon Apr 26 20:55:03 2010 New Revision: 207250 URL: http://svn.freebsd.org/changeset/base/207250 Log: MFC: r204773 Merge ACPICA 20100304. MFC: r204874 Update module Makefile for ACPICA 20100304. MFC: r204877 Allow ACPI module build on amd64. Although we strongly recommend building it into kernel, there is no need to prevent it from building at all. MFC: r204916 - Allow users to enable dumping Debug objects without ACPI debugger. Setting the new sysctl MIB "debug.acpi.enable_debug_objects" to a non-zero value enables us to print Debug object when something is written to it. - Allow users to disable interpreter slack mode. Setting the new tunable "debug.acpi.interpreter_slack" to zero disables some workarounds for common BIOS mistakes and enables strict ACPI implementations by the specification. MFC: r204920 Since the interpreter slack mode is a tunable now, enable a local hack only when it is set. Note the default behaviour does not change by this change. MFC: r204965 Fix white spaces. MFC: r206117 Merge ACPICA 20100331 (and four additional upstream patches). Added: stable/8/sys/contrib/dev/acpica/compiler/aslpredef.c - copied, changed from r204773, head/sys/contrib/dev/acpica/compiler/aslpredef.c stable/8/sys/contrib/dev/acpica/executer/exdebug.c - copied, changed from r204773, head/sys/contrib/dev/acpica/executer/exdebug.c Modified: stable/8/sys/conf/files stable/8/sys/contrib/dev/acpica/changes.txt stable/8/sys/contrib/dev/acpica/common/dmextern.c stable/8/sys/contrib/dev/acpica/common/dmtable.c stable/8/sys/contrib/dev/acpica/common/dmtbdump.c stable/8/sys/contrib/dev/acpica/common/dmtbinfo.c stable/8/sys/contrib/dev/acpica/compiler/aslanalyze.c stable/8/sys/contrib/dev/acpica/compiler/aslcompiler.h stable/8/sys/contrib/dev/acpica/compiler/aslglobal.h stable/8/sys/contrib/dev/acpica/compiler/aslmain.c stable/8/sys/contrib/dev/acpica/compiler/aslmap.c stable/8/sys/contrib/dev/acpica/compiler/aslstubs.c stable/8/sys/contrib/dev/acpica/compiler/asltypes.h stable/8/sys/contrib/dev/acpica/debugger/dbdisply.c stable/8/sys/contrib/dev/acpica/dispatcher/dsfield.c stable/8/sys/contrib/dev/acpica/dispatcher/dsmethod.c stable/8/sys/contrib/dev/acpica/dispatcher/dsmthdat.c stable/8/sys/contrib/dev/acpica/dispatcher/dsobject.c stable/8/sys/contrib/dev/acpica/dispatcher/dsopcode.c stable/8/sys/contrib/dev/acpica/dispatcher/dswexec.c stable/8/sys/contrib/dev/acpica/dispatcher/dswstate.c stable/8/sys/contrib/dev/acpica/events/evevent.c stable/8/sys/contrib/dev/acpica/events/evgpe.c stable/8/sys/contrib/dev/acpica/events/evgpeblk.c stable/8/sys/contrib/dev/acpica/events/evmisc.c stable/8/sys/contrib/dev/acpica/events/evxface.c stable/8/sys/contrib/dev/acpica/events/evxfevnt.c stable/8/sys/contrib/dev/acpica/executer/exconvrt.c stable/8/sys/contrib/dev/acpica/executer/excreate.c stable/8/sys/contrib/dev/acpica/executer/exfield.c stable/8/sys/contrib/dev/acpica/executer/exfldio.c stable/8/sys/contrib/dev/acpica/executer/exmisc.c stable/8/sys/contrib/dev/acpica/executer/exmutex.c stable/8/sys/contrib/dev/acpica/executer/exnames.c stable/8/sys/contrib/dev/acpica/executer/exoparg1.c stable/8/sys/contrib/dev/acpica/executer/exoparg2.c stable/8/sys/contrib/dev/acpica/executer/exoparg3.c stable/8/sys/contrib/dev/acpica/executer/exoparg6.c stable/8/sys/contrib/dev/acpica/executer/exprep.c stable/8/sys/contrib/dev/acpica/executer/exregion.c stable/8/sys/contrib/dev/acpica/executer/exresnte.c stable/8/sys/contrib/dev/acpica/executer/exresolv.c stable/8/sys/contrib/dev/acpica/executer/exresop.c stable/8/sys/contrib/dev/acpica/executer/exstore.c stable/8/sys/contrib/dev/acpica/executer/exsystem.c stable/8/sys/contrib/dev/acpica/hardware/hwregs.c stable/8/sys/contrib/dev/acpica/hardware/hwsleep.c stable/8/sys/contrib/dev/acpica/hardware/hwvalid.c stable/8/sys/contrib/dev/acpica/include/acdisasm.h stable/8/sys/contrib/dev/acpica/include/acevents.h stable/8/sys/contrib/dev/acpica/include/acexcep.h stable/8/sys/contrib/dev/acpica/include/acglobal.h stable/8/sys/contrib/dev/acpica/include/acinterp.h stable/8/sys/contrib/dev/acpica/include/aclocal.h stable/8/sys/contrib/dev/acpica/include/acoutput.h stable/8/sys/contrib/dev/acpica/include/acpixf.h stable/8/sys/contrib/dev/acpica/include/actables.h stable/8/sys/contrib/dev/acpica/include/actbl2.h stable/8/sys/contrib/dev/acpica/include/actypes.h stable/8/sys/contrib/dev/acpica/include/platform/acfreebsd.h stable/8/sys/contrib/dev/acpica/namespace/nsaccess.c stable/8/sys/contrib/dev/acpica/namespace/nsdump.c stable/8/sys/contrib/dev/acpica/namespace/nsnames.c stable/8/sys/contrib/dev/acpica/namespace/nssearch.c stable/8/sys/contrib/dev/acpica/namespace/nsutils.c stable/8/sys/contrib/dev/acpica/parser/psargs.c stable/8/sys/contrib/dev/acpica/parser/psloop.c stable/8/sys/contrib/dev/acpica/parser/psxface.c stable/8/sys/contrib/dev/acpica/resources/rscreate.c stable/8/sys/contrib/dev/acpica/resources/rslist.c stable/8/sys/contrib/dev/acpica/resources/rsmisc.c stable/8/sys/contrib/dev/acpica/tables/tbfadt.c stable/8/sys/contrib/dev/acpica/tables/tbutils.c stable/8/sys/contrib/dev/acpica/tables/tbxface.c stable/8/sys/contrib/dev/acpica/tables/tbxfroot.c stable/8/sys/contrib/dev/acpica/utilities/utalloc.c stable/8/sys/contrib/dev/acpica/utilities/utdelete.c stable/8/sys/contrib/dev/acpica/utilities/uteval.c stable/8/sys/contrib/dev/acpica/utilities/utglobal.c stable/8/sys/contrib/dev/acpica/utilities/utmisc.c stable/8/sys/contrib/dev/acpica/utilities/utmutex.c stable/8/sys/contrib/dev/acpica/utilities/utobject.c stable/8/sys/contrib/dev/acpica/utilities/uttrack.c stable/8/sys/dev/acpica/acpi.c stable/8/sys/dev/acpica/acpi_button.c stable/8/sys/dev/acpica/acpi_ec.c stable/8/sys/dev/acpica/acpi_lid.c stable/8/sys/dev/acpica/acpi_video.c stable/8/sys/dev/acpica/acpivar.h stable/8/sys/modules/acpi/acpi/Makefile stable/8/usr.sbin/acpi/acpidb/Makefile stable/8/usr.sbin/acpi/iasl/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) stable/8/usr.sbin/acpi/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Mon Apr 26 20:46:33 2010 (r207249) +++ stable/8/sys/conf/files Mon Apr 26 20:55:03 2010 (r207250) @@ -184,6 +184,7 @@ contrib/dev/acpica/events/evxfregn.c op contrib/dev/acpica/executer/exconfig.c optional acpi contrib/dev/acpica/executer/exconvrt.c optional acpi contrib/dev/acpica/executer/excreate.c optional acpi +contrib/dev/acpica/executer/exdebug.c optional acpi contrib/dev/acpica/executer/exdump.c optional acpi contrib/dev/acpica/executer/exfield.c optional acpi contrib/dev/acpica/executer/exfldio.c optional acpi Modified: stable/8/sys/contrib/dev/acpica/changes.txt ============================================================================== --- stable/8/sys/contrib/dev/acpica/changes.txt Mon Apr 26 20:46:33 2010 (r207249) +++ stable/8/sys/contrib/dev/acpica/changes.txt Mon Apr 26 20:55:03 2010 (r207250) @@ -1,4 +1,132 @@ ---------------------------------------- +31 March 2010. Summary of changes for version 20100331: + +1) ACPI CA Core Subsystem: + +Completed a major update for the GPE support in order to improve support for +shared GPEs and to simplify both host OS and ACPICA code. Added a reference +count mechanism to support shared GPEs that require multiple device drivers. +Several external interfaces have changed. One external interface has been +removed. One new external interface was added. Most of the GPE external +interfaces now use the GPE spinlock instead of the events mutex (and the +Flags parameter for many GPE interfaces has been removed.) See the updated +ACPICA Programmer Reference for details. Matthew Garrett, Bob Moore, Rafael +Wysocki. ACPICA BZ 831. + +Changed: + AcpiEnableGpe, AcpiDisableGpe, AcpiClearGpe, AcpiGetGpeStatus +Removed: + AcpiSetGpeType +New: + AcpiSetGpe + +Implemented write support for DataTable operation regions. These regions are +defined via the DataTableRegion() operator. Previously, only read support was +implemented. The ACPI specification allows DataTableRegions to be read/write, +however. + +Implemented a new subsystem option to force a copy of the DSDT to local +memory. Optionally copy the entire DSDT to local memory (instead of simply +mapping it.) There are some (albeit very rare) BIOSs that corrupt or replace +the original DSDT, creating the need for this option. Default is FALSE, do +not copy the DSDT. + +Implemented detection of a corrupted or replaced DSDT. This change adds +support to detect a DSDT that has been corrupted and/or replaced from outside +the OS (by firmware). This is typically catastrophic for the system, but has +been seen on some machines. Once this problem has been detected, the DSDT +copy option can be enabled via system configuration. Lin Ming, Bob Moore. + +Fixed two problems with AcpiReallocateRootTable during the root table copy. +When copying the root table to the new allocation, the length used was +incorrect. The new size was used instead of the current table size, meaning +too much data was copied. Also, the count of available slots for ACPI tables +was not set correctly. Alexey Starikovskiy, Bob Moore. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 87.5K Code, 18.4K Data, 105.9K Total + Debug Version: 163.4K Code, 51.1K Data, 214.5K Total + Current Release: + Non-Debug Version: 87.9K Code, 18.6K Data, 106.5K Total + Debug Version: 163.5K Code, 51.3K Data, 214.8K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implement limited typechecking for values returned from predefined +control methods. The type of any returned static (unnamed) object is now +validated. For example, Return(1). ACPICA BZ 786. + +iASL: Fixed a predefined name object verification regression. Fixes a problem +introduced in version 20100304. An error is incorrectly generated if a +predefined name is declared as a static named object with a value defined +using the keywords "Zero", "One", or "Ones". Lin Ming. + +iASL: Added Windows 7 support for the -g option (get local ACPI tables) by +reducing the requested registry access rights. ACPICA BZ 842. + +Disassembler: fixed a possible fault when generating External() statements. +Introduced in commit ae7d6fd: Properly handle externals with parent-prefix +(carat). Fixes a string length allocation calculation. Lin Ming. + +---------------------------------------- +04 March 2010. Summary of changes for version 20100304: + +1) ACPI CA Core Subsystem: + +Fixed a possible problem with the AML Mutex handling function +AcpiExReleaseMutex where the function could fault under the very rare +condition when the interpreter has blocked, the interpreter lock is released, +the interpreter is then reentered via the same thread, and attempts to +acquire an AML mutex that was previously acquired. FreeBSD report 140979. Lin +Ming. + +Implemented additional configuration support for the AML "Debug Object". +Output from the debug object can now be enabled via a global variable, +AcpiGbl_EnableAmlDebugObject. This will assist with remote machine debugging. +This debug output is now available in the release version of ACPICA instead +of just the debug version. Also, the entire debug output module can now be +configured out of the ACPICA build if desired. One new file added, +executer/exdebug.c. Lin Ming, Bob Moore. + +Added header support for the ACPI MCHI table (Management Controller Host +Interface Table). This table was added in ACPI 4.0, but the defining document +has only recently become available. + +Standardized output of integer values for ACPICA warnings/errors. Always use +0x prefix for hex output, always use %u for unsigned integer decimal output. +Affects ACPI_INFO, ACPI_ERROR, ACPI_EXCEPTION, and ACPI_WARNING (about 400 +invocations.) These invocations were converted from the original +ACPI_DEBUG_PRINT invocations and were not consistent. ACPICA BZ 835. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 87.1K Code, 18.0K Data, 105.1K Total + Debug Version: 163.5K Code, 50.9K Data, 214.4K Total + Current Release: + Non-Debug Version: 87.5K Code, 18.4K Data, 105.9K Total + Debug Version: 163.4K Code, 51.1K Data, 214.5K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented typechecking support for static (non-control method) +predefined named objects that are declared with the Name() operator. For +example, the type of this object is now validated to be of type Integer: +Name(_BBN, 1). This change migrates the compiler to using the core predefined +name table instead of maintaining a local version. Added a new file, +aslpredef.c. ACPICA BZ 832. + +Disassembler: Added support for the ACPI 4.0 MCHI table. + +---------------------------------------- 21 January 2010. Summary of changes for version 20100121: 1) ACPI CA Core Subsystem: Modified: stable/8/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- stable/8/sys/contrib/dev/acpica/common/dmextern.c Mon Apr 26 20:46:33 2010 (r207249) +++ stable/8/sys/contrib/dev/acpica/common/dmextern.c Mon Apr 26 20:55:03 2010 (r207250) @@ -270,6 +270,15 @@ AcpiDmNormalizeParentPrefix ( } Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1); + if (ParentPath[1]) + { + /* + * If ParentPath is not just a simple '\', increment the length + * for the required dot separator (ParentPath.Path) + */ + Length++; + } + Fullpath = ACPI_ALLOCATE_ZEROED (Length); if (!Fullpath) { @@ -374,7 +383,7 @@ AcpiDmAddToExternalList ( (NextExternal->Value != Value)) { ACPI_ERROR ((AE_INFO, - "Argument count mismatch for method %s %d %d", + "Argument count mismatch for method %s %u %u", NextExternal->Path, NextExternal->Value, Value)); } Modified: stable/8/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- stable/8/sys/contrib/dev/acpica/common/dmtable.c Mon Apr 26 20:46:33 2010 (r207249) +++ stable/8/sys/contrib/dev/acpica/common/dmtable.c Mon Apr 26 20:55:03 2010 (r207250) @@ -262,6 +262,7 @@ static ACPI_DMTABLE_DATA AcpiDmTableD {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, "I/O Virtualization Reporting Structure"}, {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, "Multiple APIC Description Table"}, {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, "Memory Mapped Configuration table"}, + {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, "Management Controller Host Interface table"}, {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, "Maximum System Characteristics Table"}, {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, "Root System Description Table"}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, "Smart Battery Specification Table"}, @@ -911,7 +912,7 @@ AcpiDmDumpTable ( default: ACPI_ERROR ((AE_INFO, - "**** Invalid table opcode [%X] ****\n", Info->Opcode)); + "**** Invalid table opcode [0x%X] ****\n", Info->Opcode)); return (AE_SUPPORT); } } Modified: stable/8/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- stable/8/sys/contrib/dev/acpica/common/dmtbdump.c Mon Apr 26 20:46:33 2010 (r207249) +++ stable/8/sys/contrib/dev/acpica/common/dmtbdump.c Mon Apr 26 20:55:03 2010 (r207250) @@ -363,7 +363,7 @@ AcpiDmDumpAsf ( break; default: - AcpiOsPrintf ("\n**** Unknown ASF sub-table type %X\n", SubTable->Header.Type); + AcpiOsPrintf ("\n**** Unknown ASF sub-table type 0x%X\n", SubTable->Header.Type); return; } @@ -561,7 +561,7 @@ AcpiDmDumpDmar ( ScopeOffset = sizeof (ACPI_DMAR_RHSA); break; default: - AcpiOsPrintf ("\n**** Unknown DMAR sub-table type %X\n\n", SubTable->Type); + AcpiOsPrintf ("\n**** Unknown DMAR sub-table type 0x%X\n\n", SubTable->Type); return; } @@ -809,7 +809,7 @@ AcpiDmDumpHest ( default: /* Cannot continue on unknown type - no length */ - AcpiOsPrintf ("\n**** Unknown HEST sub-table type %X\n", SubTable->Type); + AcpiOsPrintf ("\n**** Unknown HEST sub-table type 0x%X\n", SubTable->Type); return; } @@ -916,7 +916,7 @@ AcpiDmDumpIvrs ( InfoTable = AcpiDmTableInfoIvrs1; break; default: - AcpiOsPrintf ("\n**** Unknown IVRS sub-table type %X\n", + AcpiOsPrintf ("\n**** Unknown IVRS sub-table type 0x%X\n", SubTable->Type); /* Attempt to continue */ @@ -1002,7 +1002,7 @@ AcpiDmDumpIvrs ( InfoTable = AcpiDmTableInfoIvrs4; AcpiOsPrintf ( "\n**** Unknown IVRS device entry type/length: " - "%.2X/%X at offset %.4X: (header below)\n", + "0x%.2X/0x%X at offset 0x%.4X: (header below)\n", EntryType, EntryLength, EntryOffset); break; } @@ -1110,7 +1110,7 @@ AcpiDmDumpMadt ( InfoTable = AcpiDmTableInfoMadt10; break; default: - AcpiOsPrintf ("\n**** Unknown MADT sub-table type %X\n\n", SubTable->Type); + AcpiOsPrintf ("\n**** Unknown MADT sub-table type 0x%X\n\n", SubTable->Type); /* Attempt to continue */ @@ -1378,7 +1378,7 @@ AcpiDmDumpSrat ( InfoTable = AcpiDmTableInfoSrat2; break; default: - AcpiOsPrintf ("\n**** Unknown SRAT sub-table type %X\n", SubTable->Type); + AcpiOsPrintf ("\n**** Unknown SRAT sub-table type 0x%X\n", SubTable->Type); /* Attempt to continue */ Modified: stable/8/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- stable/8/sys/contrib/dev/acpica/common/dmtbinfo.c Mon Apr 26 20:46:33 2010 (r207249) +++ stable/8/sys/contrib/dev/acpica/common/dmtbinfo.c Mon Apr 26 20:55:03 2010 (r207250) @@ -142,6 +142,7 @@ #define ACPI_IVRS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_IVRS,f) #define ACPI_MADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MADT,f) #define ACPI_MCFG_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCFG,f) +#define ACPI_MCHI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCHI,f) #define ACPI_MSCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MSCT,f) #define ACPI_SBST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SBST,f) #define ACPI_SLIT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SLIT,f) @@ -1226,6 +1227,30 @@ ACPI_DMTABLE_INFO AcpiDmTableI /******************************************************************************* * + * MCHI - Management Controller Host Interface table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[] = +{ + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (InterfaceType), "Interface Type"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (Protocol), "Protocol"}, + {ACPI_DMT_UINT64, ACPI_MCHI_OFFSET (ProtocolData), "Protocol Data"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (InterruptType), "Interrupt Type"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (Gpe), "Gpe"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciDeviceFlag), "Pci Device Flag"}, + {ACPI_DMT_UINT32, ACPI_MCHI_OFFSET (GlobalInterrupt), "Global Interrupt"}, + {ACPI_DMT_GAS, ACPI_MCHI_OFFSET (ControlRegister), "Control Register"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciSegment), "Pci Segment"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciBus), "Pci Bus"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciDevice), "Pci Device"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciFunction), "Pci Function"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + + +/******************************************************************************* + * * MSCT - Maximum System Characteristics Table (ACPI 4.0) * ******************************************************************************/ Modified: stable/8/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- stable/8/sys/contrib/dev/acpica/compiler/aslanalyze.c Mon Apr 26 20:46:33 2010 (r207249) +++ stable/8/sys/contrib/dev/acpica/compiler/aslanalyze.c Mon Apr 26 20:55:03 2010 (r207250) @@ -143,16 +143,6 @@ AnGetBtype ( ACPI_PARSE_OBJECT *Op); static UINT32 -AnCheckForReservedName ( - ACPI_PARSE_OBJECT *Op, - char *Name); - -static void -AnCheckForReservedMethod ( - ACPI_PARSE_OBJECT *Op, - ASL_METHOD_INFO *MethodInfo); - -static UINT32 AnMapObjTypeToBtype ( ACPI_PARSE_OBJECT *Op); @@ -598,219 +588,6 @@ AnGetBtype ( /******************************************************************************* * - * FUNCTION: AnCheckForReservedName - * - * PARAMETERS: Op - A parse node - * Name - NameSeg to check - * - * RETURN: None - * - * DESCRIPTION: Check a NameSeg against the reserved list. - * - ******************************************************************************/ - -static UINT32 -AnCheckForReservedName ( - ACPI_PARSE_OBJECT *Op, - char *Name) -{ - UINT32 i; - - - if (Name[0] == 0) - { - AcpiOsPrintf ("Found a null name, external = %s\n", - Op->Asl.ExternalName); - } - - /* All reserved names are prefixed with a single underscore */ - - if (Name[0] != '_') - { - return (ACPI_NOT_RESERVED_NAME); - } - - /* Check for a standard reserved method name */ - - for (i = 0; ReservedMethods[i].Name; i++) - { - if (ACPI_COMPARE_NAME (Name, ReservedMethods[i].Name)) - { - if (ReservedMethods[i].Flags & ASL_RSVD_SCOPE) - { - AslError (ASL_ERROR, ASL_MSG_RESERVED_WORD, Op, - Op->Asl.ExternalName); - return (ACPI_PREDEFINED_NAME); - } - else if (ReservedMethods[i].Flags & ASL_RSVD_RESOURCE_NAME) - { - AslError (ASL_ERROR, ASL_MSG_RESERVED_WORD, Op, - Op->Asl.ExternalName); - return (ACPI_PREDEFINED_NAME); - } - - /* Return index into reserved array */ - - return i; - } - } - - /* - * Now check for the "special" reserved names -- - * GPE: _Lxx - * GPE: _Exx - * EC: _Qxx - */ - if ((Name[1] == 'L') || - (Name[1] == 'E') || - (Name[1] == 'Q')) - { - /* The next two characters must be hex digits */ - - if ((isxdigit ((int) Name[2])) && - (isxdigit ((int) Name[3]))) - { - return (ACPI_EVENT_RESERVED_NAME); - } - } - - - /* Check for the names reserved for the compiler itself: _T_x */ - - else if ((Op->Asl.ExternalName[1] == 'T') && - (Op->Asl.ExternalName[2] == '_')) - { - /* Ignore if actually emitted by the compiler */ - - if (Op->Asl.CompileFlags & NODE_COMPILER_EMITTED) - { - return (ACPI_NOT_RESERVED_NAME); - } - - /* - * Was not actually emitted by the compiler. This is a special case, - * however. If the ASL code being compiled was the result of a - * dissasembly, it may possibly contain valid compiler-emitted names - * of the form "_T_x". We don't want to issue an error or even a - * warning and force the user to manually change the names. So, we - * will issue a remark instead. - */ - AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED, Op, Op->Asl.ExternalName); - return (ACPI_COMPILER_RESERVED_NAME); - } - - /* - * The name didn't match any of the known reserved names. Flag it as a - * warning, since the entire namespace starting with an underscore is - * reserved by the ACPI spec. - */ - AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME, Op, - Op->Asl.ExternalName); - - return (ACPI_NOT_RESERVED_NAME); -} - - -/******************************************************************************* - * - * FUNCTION: AnCheckForReservedMethod - * - * PARAMETERS: Op - A parse node of type "METHOD". - * MethodInfo - Saved info about this method - * - * RETURN: None - * - * DESCRIPTION: If method is a reserved name, check that the number of arguments - * and the return type (returns a value or not) is correct. - * - ******************************************************************************/ - -static void -AnCheckForReservedMethod ( - ACPI_PARSE_OBJECT *Op, - ASL_METHOD_INFO *MethodInfo) -{ - UINT32 Index; - UINT32 RequiredArgsCurrent; - UINT32 RequiredArgsOld; - - - /* Check for a match against the reserved name list */ - - Index = AnCheckForReservedName (Op, Op->Asl.NameSeg); - - switch (Index) - { - case ACPI_NOT_RESERVED_NAME: - case ACPI_PREDEFINED_NAME: - case ACPI_COMPILER_RESERVED_NAME: - - /* Just return, nothing to do */ - break; - - - case ACPI_EVENT_RESERVED_NAME: - - Gbl_ReservedMethods++; - - /* NumArguments must be zero for all _Lxx, _Exx, and _Qxx methods */ - - if (MethodInfo->NumArguments != 0) - { - sprintf (MsgBuffer, "%s requires %d", - Op->Asl.ExternalName, 0); - - AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, MsgBuffer); - } - break; - - - default: - - Gbl_ReservedMethods++; - - /* - * Matched a reserved method name - * - * Validate the ASL-defined argument count. Allow two different legal - * arg counts. - */ - RequiredArgsCurrent = ReservedMethods[Index].NumArguments & 0x0F; - RequiredArgsOld = ReservedMethods[Index].NumArguments >> 4; - - if ((MethodInfo->NumArguments != RequiredArgsCurrent) && - (MethodInfo->NumArguments != RequiredArgsOld)) - { - sprintf (MsgBuffer, "%s requires %d", - ReservedMethods[Index].Name, - RequiredArgsCurrent); - - if (MethodInfo->NumArguments > RequiredArgsCurrent) - { - AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, - MsgBuffer); - } - else - { - AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op, - MsgBuffer); - } - } - - if (MethodInfo->NumReturnNoValue && - ReservedMethods[Index].Flags & ASL_RSVD_RETURN_VALUE) - { - sprintf (MsgBuffer, "%s", ReservedMethods[Index].Name); - - AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op, MsgBuffer); - } - break; - } -} - - -/******************************************************************************* - * * FUNCTION: AnMapObjTypeToBtype * * PARAMETERS: Op - A parse node @@ -1187,7 +964,7 @@ AnMethodAnalysisWalkBegin ( * The first operand is a name to be created in the namespace. * Check against the reserved list. */ - i = AnCheckForReservedName (Op, Op->Asl.NameSeg); + i = ApCheckForPredefinedName (Op, Op->Asl.NameSeg); if (i < ACPI_VALID_RESERVED_NAME_MAX) { AslError (ASL_ERROR, ASL_MSG_RESERVED_USE, Op, Op->Asl.ExternalName); @@ -1197,51 +974,29 @@ AnMethodAnalysisWalkBegin ( case PARSEOP_NAME: - i = AnCheckForReservedName (Op, Op->Asl.NameSeg); - if (i < ACPI_VALID_RESERVED_NAME_MAX) + /* Typecheck any predefined names statically defined with Name() */ + + ApCheckForPredefinedObject (Op, Op->Asl.NameSeg); + + /* Special typechecking for _HID */ + + if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg)) { - if (ReservedMethods[i].NumArguments > 0) + Next = Op->Asl.Child->Asl.Next; + if (Next->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) { /* - * This reserved name must be a control method because - * it must have arguments + * _HID is a string, all characters must be alphanumeric. + * One of the things we want to catch here is the use of + * a leading asterisk in the string. */ - AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, - "with arguments"); - } - - /* Typechecking for _HID */ - - else if (!ACPI_STRCMP (METHOD_NAME__HID, ReservedMethods[i].Name)) - { - /* Examine the second operand to typecheck it */ - - Next = Op->Asl.Child->Asl.Next; - - if ((Next->Asl.ParseOpcode != PARSEOP_INTEGER) && - (Next->Asl.ParseOpcode != PARSEOP_STRING_LITERAL)) + for (i = 0; Next->Asl.Value.String[i]; i++) { - /* _HID must be a string or an integer */ - - AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Next, - "String or Integer"); - } - - if (Next->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) - { - /* - * _HID is a string, all characters must be alphanumeric. - * One of the things we want to catch here is the use of - * a leading asterisk in the string. - */ - for (i = 0; Next->Asl.Value.String[i]; i++) + if (!isalnum ((int) Next->Asl.Value.String[i])) { - if (!isalnum ((int) Next->Asl.Value.String[i])) - { - AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, - Next, Next->Asl.Value.String); - break; - } + AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, + Next, Next->Asl.Value.String); + break; } } } @@ -1394,7 +1149,7 @@ AnMethodAnalysisWalkEnd ( * Check predefined method names for correct return behavior * and correct number of arguments */ - AnCheckForReservedMethod (Op, MethodInfo); + ApCheckForPredefinedMethod (Op, MethodInfo); ACPI_FREE (MethodInfo); break; @@ -1402,6 +1157,12 @@ AnMethodAnalysisWalkEnd ( case PARSEOP_RETURN: /* + * If the parent is a predefined method name, attempt to typecheck + * the return value. Only static types can be validated. + */ + ApCheckPredefinedReturnValue (Op, MethodInfo); + + /* * The parent block does not "exit" and continue execution -- the * method is terminated here with the Return() statement. */ Modified: stable/8/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- stable/8/sys/contrib/dev/acpica/compiler/aslcompiler.h Mon Apr 26 20:46:33 2010 (r207249) +++ stable/8/sys/contrib/dev/acpica/compiler/aslcompiler.h Mon Apr 26 20:55:03 2010 (r207250) @@ -452,8 +452,32 @@ ACPI_OBJECT_TYPE AslMapNamedOpcodeToDataType ( UINT16 Opcode); + +/* + * aslpredef - ACPI predefined names support + */ +void +ApCheckForPredefinedMethod ( + ACPI_PARSE_OBJECT *Op, + ASL_METHOD_INFO *MethodInfo); + +void +ApCheckPredefinedReturnValue ( + ACPI_PARSE_OBJECT *Op, + ASL_METHOD_INFO *MethodInfo); + +UINT32 +ApCheckForPredefinedName ( + ACPI_PARSE_OBJECT *Op, + char *Name); + +void +ApCheckForPredefinedObject ( + ACPI_PARSE_OBJECT *Op, + char *Name); + void -MpDisplayReservedNames ( +ApDisplayReservedNames ( void); Modified: stable/8/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- stable/8/sys/contrib/dev/acpica/compiler/aslglobal.h Mon Apr 26 20:46:33 2010 (r207249) +++ stable/8/sys/contrib/dev/acpica/compiler/aslglobal.h Mon Apr 26 20:55:03 2010 (r207250) @@ -261,7 +261,6 @@ ASL_EXTERN FILE *Acp ASL_EXTERN ASL_ANALYSIS_WALK_INFO AnalysisWalkInfo; ASL_EXTERN ACPI_TABLE_HEADER TableHeader; -extern const ASL_RESERVED_INFO ReservedMethods[]; /* Event timing */ Modified: stable/8/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- stable/8/sys/contrib/dev/acpica/compiler/aslmain.c Mon Apr 26 20:46:33 2010 (r207249) +++ stable/8/sys/contrib/dev/acpica/compiler/aslmain.c Mon Apr 26 20:55:03 2010 (r207250) @@ -570,7 +570,7 @@ AslDoOptions ( case 'r': /* reserved names */ - MpDisplayReservedNames (); + ApDisplayReservedNames (); exit (0); default: Modified: stable/8/sys/contrib/dev/acpica/compiler/aslmap.c ============================================================================== --- stable/8/sys/contrib/dev/acpica/compiler/aslmap.c Mon Apr 26 20:46:33 2010 (r207249) +++ stable/8/sys/contrib/dev/acpica/compiler/aslmap.c Mon Apr 26 20:55:03 2010 (r207250) @@ -114,7 +114,6 @@ * *****************************************************************************/ - #include #include #include @@ -171,322 +170,6 @@ AslMapNamedOpcodeToDataType ( /******************************************************************************* * - * FUNCTION: MpDisplayReservedNames - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Print the table above - * - ******************************************************************************/ - -void -MpDisplayReservedNames ( - void) -{ - UINT32 i; - - printf ("Reserved name information\n\n"); - - for (i = 0; ReservedMethods[i].Name; i++) - { - printf ("%s ", ReservedMethods[i].Name); - - if (ReservedMethods[i].Flags & ASL_RSVD_SCOPE) - { - printf ("Reserved scope name\n"); - } - else if (ReservedMethods[i].Flags & ASL_RSVD_RESOURCE_NAME) - { - printf ("Resource data type reserved field name\n"); - } - else - { - printf ("Method with %d arguments, ", - ReservedMethods[i].NumArguments & 0x0F); - - if (ReservedMethods[i].Flags & ASL_RSVD_RETURN_VALUE) - { - printf ("must return a value\n"); - } - else - { - printf ("no return value\n"); - } - } - } -} - - -/******************************************************************************* - * - * DATA STRUCTURE: ReservedMethods - * - * DESCRIPTION: Contains all reserved methods and names as defined in the - * ACPI specification. Used during the analysis phase to - * ensure that reserved methods have the required number of - * arguments and the proper return type. - * - * Each entry in the table contains the following items: - * - * Name - The ACPI reserved name - * Args - Number of arguments to the method - * Flags - Whether this method must return a value or not. Or if the - * name is a resource descriptor label. - * - ******************************************************************************/ - -const ASL_RESERVED_INFO ReservedMethods[] = { - {"_AC0", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC1", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC2", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC3", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC4", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC5", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC6", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC7", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC8", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC9", 0, ASL_RSVD_RETURN_VALUE}, - {"_ADR", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL0", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL1", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL2", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL3", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL4", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL5", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL6", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL7", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL8", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL9", 0, ASL_RSVD_RETURN_VALUE}, - {"_ALC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_ALI", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_ALN", 0, ASL_RSVD_RESOURCE_NAME}, - {"_ALP", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_ALR", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_ALT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_ART", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_ASI", 0, ASL_RSVD_RESOURCE_NAME}, - {"_ASZ", 0, ASL_RSVD_RESOURCE_NAME}, - {"_BAS", 0, ASL_RSVD_RESOURCE_NAME}, - {"_BBN", 0, ASL_RSVD_RETURN_VALUE}, - {"_BCL", 0, ASL_RSVD_RETURN_VALUE}, - {"_BCM", 1, 0}, - {"_BCT", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_BDN", 0, ASL_RSVD_RETURN_VALUE}, - {"_BFS", 1, 0}, - {"_BIF", 0, ASL_RSVD_RETURN_VALUE}, - {"_BIX", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_BLT", 3, 0}, /* Acpi 3.0 */ - {"_BM_", 0, ASL_RSVD_RESOURCE_NAME}, - {"_BMA", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_BMC", 1, 0}, /* Acpi 3.0 */ - {"_BMD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_BMS", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_BQC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_BST", 0, ASL_RSVD_RETURN_VALUE}, - {"_BTM", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_BTP", 1, 0}, - {"_CBA", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_CDM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_CID", 0, ASL_RSVD_RETURN_VALUE}, - {"_CRS", 0, ASL_RSVD_RETURN_VALUE}, - {"_CRT", 0, ASL_RSVD_RETURN_VALUE}, - {"_CSD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_CST", 0, ASL_RSVD_RETURN_VALUE}, - {"_DCK", 1, ASL_RSVD_RETURN_VALUE}, - {"_DCS", 0, ASL_RSVD_RETURN_VALUE}, - {"_DDC", 1, ASL_RSVD_RETURN_VALUE}, - {"_DDN", 0, 0}, - {"_DEC", 0, ASL_RSVD_RESOURCE_NAME}, - {"_DGS", 0, ASL_RSVD_RETURN_VALUE}, - {"_DIS", 0, 0}, - {"_DMA", 0, ASL_RSVD_RETURN_VALUE}, - {"_DOD", 0, ASL_RSVD_RETURN_VALUE}, - {"_DOS", 1, 0}, - {"_DSM", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_DSS", 1, 0}, - {"_DSW", 3, 0}, /* Acpi 3.0 */ - {"_DTI", 1, 0}, /* Acpi 4.0 */ - {"_EC_", 0, ASL_RSVD_RETURN_VALUE}, - {"_EDL", 0, ASL_RSVD_RETURN_VALUE}, - {"_EJ0", 1, 0}, - {"_EJ1", 1, 0}, - {"_EJ2", 1, 0}, - {"_EJ3", 1, 0}, - {"_EJ4", 1, 0}, - {"_EJD", 0, ASL_RSVD_RETURN_VALUE}, - {"_ERR", 3, ASL_RSVD_RETURN_VALUE}, - {"_FDE", 0, ASL_RSVD_RETURN_VALUE}, - {"_FDI", 0, ASL_RSVD_RETURN_VALUE}, - {"_FDM", 1, 0}, - {"_FIF", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_FIX", 0, ASL_RSVD_RETURN_VALUE}, - {"_FPS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_FSL", 1, 0}, /* Acpi 4.0 */ - {"_FST", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_GAI", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_GHL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_GL_", 0, ASL_RSVD_RETURN_VALUE}, - {"_GLK", 0, ASL_RSVD_RETURN_VALUE}, - {"_GPD", 0, ASL_RSVD_RETURN_VALUE}, - {"_GPE", 0, ASL_RSVD_RETURN_VALUE}, - {"_GRA", 0, ASL_RSVD_RESOURCE_NAME}, - {"_GSB", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_GTF", 0, ASL_RSVD_RETURN_VALUE}, - {"_GTM", 0, ASL_RSVD_RETURN_VALUE}, - {"_GTS", 1, 0}, - {"_HE_", 0, ASL_RSVD_RESOURCE_NAME}, - {"_HID", 0, ASL_RSVD_RETURN_VALUE}, - {"_HOT", 0, ASL_RSVD_RETURN_VALUE}, - {"_HPP", 0, ASL_RSVD_RETURN_VALUE}, - {"_HPX", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_IFT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_INI", 0, 0}, - {"_INT", 0, ASL_RSVD_RESOURCE_NAME}, - {"_IRC", 0, 0}, - {"_LCK", 1, 0}, - {"_LEN", 0, ASL_RSVD_RESOURCE_NAME}, - {"_LID", 0, ASL_RSVD_RETURN_VALUE}, - {"_LL_", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MAF", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MAT", 0, ASL_RSVD_RETURN_VALUE}, - {"_MAX", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MBM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_MEM", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MIF", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MIN", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MLS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_MSG", 1, 0}, - {"_MSM", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_MTP", 0, ASL_RSVD_RESOURCE_NAME}, - {"_NTT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_OFF", 0, 0}, - {"_ON_", 0, 0}, - {"_OS_", 0, ASL_RSVD_RETURN_VALUE}, - {"_OSC", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_OSI", 1, ASL_RSVD_RETURN_VALUE}, - {"_OST", 3, 0}, /* Acpi 3.0 */ - {"_PAI", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PCL", 0, ASL_RSVD_RETURN_VALUE}, - {"_PCT", 0, ASL_RSVD_RETURN_VALUE}, - {"_PDC", 1, 0}, - {"_PDL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PIC", 1, 0}, - {"_PIF", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PLD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_PMC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PMD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PMM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PPC", 0, ASL_RSVD_RETURN_VALUE}, - {"_PPE", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_PR0", 0, ASL_RSVD_RETURN_VALUE}, - {"_PR1", 0, ASL_RSVD_RETURN_VALUE}, - {"_PR2", 0, ASL_RSVD_RETURN_VALUE}, - {"_PR3", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PRL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PRS", 0, ASL_RSVD_RETURN_VALUE}, - {"_PRT", 0, ASL_RSVD_RETURN_VALUE}, - {"_PRW", 0, ASL_RSVD_RETURN_VALUE}, - {"_PS0", 0, 0}, - {"_PS1", 0, 0}, - {"_PS2", 0, 0}, - {"_PS3", 0, 0}, - {"_PSC", 0, ASL_RSVD_RETURN_VALUE}, - {"_PSD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_PSL", 0, ASL_RSVD_RETURN_VALUE}, - {"_PSR", 0, ASL_RSVD_RETURN_VALUE}, - {"_PSS", 0, ASL_RSVD_RETURN_VALUE}, - {"_PSV", 0, ASL_RSVD_RETURN_VALUE}, - {"_PSW", 1, 0}, - {"_PTC", 0, ASL_RSVD_RETURN_VALUE}, - {"_PTP", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PTS", 1, 0}, - {"_PUR", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PXM", 0, ASL_RSVD_RETURN_VALUE}, - {"_RBO", 0, ASL_RSVD_RESOURCE_NAME}, - {"_RBW", 0, ASL_RSVD_RESOURCE_NAME}, - {"_REG", 2, 0}, - {"_REV", 0, ASL_RSVD_RETURN_VALUE}, - {"_RMV", 0, ASL_RSVD_RETURN_VALUE}, - {"_RNG", 0, ASL_RSVD_RESOURCE_NAME}, - {"_ROM", 2, ASL_RSVD_RETURN_VALUE}, - {"_RT_", 0, ASL_RSVD_RESOURCE_NAME}, /* Acpi 3.0 */ - {"_RTV", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_RW_", 0, ASL_RSVD_RESOURCE_NAME}, - {"_S0_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S1_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S2_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S3_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S4_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S5_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S1D", 0, ASL_RSVD_RETURN_VALUE}, - {"_S2D", 0, ASL_RSVD_RETURN_VALUE}, - {"_S3D", 0, ASL_RSVD_RETURN_VALUE}, - {"_S4D", 0, ASL_RSVD_RETURN_VALUE}, - {"_S0W", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_S1W", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_S2W", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_S3W", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_S4W", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_SB_", 0, ASL_RSVD_SCOPE}, - {"_SBS", 0, ASL_RSVD_RETURN_VALUE}, - {"_SCP", 0x13, 0}, /* Acpi 1.0 - one arg; Acpi 3.0 - three args */ - {"_SDD", 1, 0}, /* Acpi 3.0 */ - {"_SEG", 0, ASL_RSVD_RETURN_VALUE}, - {"_SHL", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_SHR", 0, ASL_RSVD_RESOURCE_NAME}, - {"_SI_", 0, ASL_RSVD_SCOPE}, - {"_SIZ", 0, ASL_RSVD_RESOURCE_NAME}, - {"_SLI", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_SPD", 1, ASL_RSVD_RETURN_VALUE}, - {"_SRS", 1, 0}, - {"_SRV", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_SST", 1, 0}, - {"_STA", 0, ASL_RSVD_RETURN_VALUE}, - {"_STM", 3, 0}, - {"_STP", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_STR", 0, ASL_RSVD_RETURN_VALUE}, - {"_STV", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_SUN", 0, ASL_RSVD_RETURN_VALUE}, - {"_SWS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_TC1", 0, ASL_RSVD_RETURN_VALUE}, - {"_TC2", 0, ASL_RSVD_RETURN_VALUE}, - {"_TDL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0b */ - {"_TIP", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_TIV", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_TMP", 0, ASL_RSVD_RETURN_VALUE}, - {"_TPC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_TPT", 1, 0}, /* Acpi 3.0 */ - {"_TRA", 0, ASL_RSVD_RESOURCE_NAME}, - {"_TRS", 0, ASL_RSVD_RESOURCE_NAME}, - {"_TRT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_TSD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_TSF", 0, ASL_RSVD_RESOURCE_NAME}, /* Acpi 3.0 */ - {"_TSP", 0, ASL_RSVD_RETURN_VALUE}, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 21:08:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AE631065676; Mon, 26 Apr 2010 21:08:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49C8F8FC1F; Mon, 26 Apr 2010 21:08: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 o3QL8Fv2001060; Mon, 26 Apr 2010 21:08:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QL8Fws001058; Mon, 26 Apr 2010 21:08:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004262108.o3QL8Fws001058@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 26 Apr 2010 21:08: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: r207251 - head/sys/dev/ale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 21:08:15 -0000 Author: yongari Date: Mon Apr 26 21:08:15 2010 New Revision: 207251 URL: http://svn.freebsd.org/changeset/base/207251 Log: It seems ale(4) controllers do not like to see TCP payload in the first descriptor in TSO case. Otherwise controller can generate bad frames during TSO. To address it, make sure to pull up ethernet + IP + TCP header with options in first buffer. Also ensure the buffer length of the first descriptor for TSO covers entire ethernet + IP + TCP with options and setup additional Tx descriptor if the first buffer includes TCP payload. Tested by: Amar Takhar darkbeer dot org > MFC after: 1 week Modified: head/sys/dev/ale/if_ale.c Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Mon Apr 26 20:55:03 2010 (r207250) +++ head/sys/dev/ale/if_ale.c Mon Apr 26 21:08:15 2010 (r207251) @@ -1585,7 +1585,7 @@ ale_encap(struct ale_softc *sc, struct m struct tcphdr *tcp; bus_dma_segment_t txsegs[ALE_MAXTXSEGS]; bus_dmamap_t map; - uint32_t cflags, ip_off, poff, vtag; + uint32_t cflags, hdrlen, ip_off, poff, vtag; int error, i, nsegs, prod, si; ALE_LOCK_ASSERT(sc); @@ -1678,6 +1678,11 @@ ale_encap(struct ale_softc *sc, struct m return (ENOBUFS); } tcp = (struct tcphdr *)(mtod(m, char *) + poff); + m = m_pullup(m, poff + (tcp->th_off << 2)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } /* * AR81xx requires IP/TCP header size and offset as * well as TCP pseudo checksum which complicates @@ -1730,7 +1735,7 @@ ale_encap(struct ale_softc *sc, struct m } /* Check descriptor overrun. */ - if (sc->ale_cdata.ale_tx_cnt + nsegs >= ALE_TX_RING_CNT - 2) { + if (sc->ale_cdata.ale_tx_cnt + nsegs >= ALE_TX_RING_CNT - 3) { bus_dmamap_unload(sc->ale_cdata.ale_tx_tag, map); return (ENOBUFS); } @@ -1782,8 +1787,32 @@ ale_encap(struct ale_softc *sc, struct m cflags |= ALE_TD_INSERT_VLAN_TAG; } - desc = NULL; - for (i = 0; i < nsegs; i++) { + i = 0; + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + /* + * Make sure the first fragment contains + * only ethernet and IP/TCP header with options. + */ + hdrlen = poff + (tcp->th_off << 2); + desc = &sc->ale_cdata.ale_tx_ring[prod]; + desc->addr = htole64(txsegs[i].ds_addr); + desc->len = htole32(ALE_TX_BYTES(hdrlen) | vtag); + desc->flags = htole32(cflags); + sc->ale_cdata.ale_tx_cnt++; + ALE_DESC_INC(prod, ALE_TX_RING_CNT); + if (m->m_len - hdrlen > 0) { + /* Handle remaining payload of the first fragment. */ + desc = &sc->ale_cdata.ale_tx_ring[prod]; + desc->addr = htole64(txsegs[i].ds_addr + hdrlen); + desc->len = htole32(ALE_TX_BYTES(m->m_len - hdrlen) | + vtag); + desc->flags = htole32(cflags); + sc->ale_cdata.ale_tx_cnt++; + ALE_DESC_INC(prod, ALE_TX_RING_CNT); + } + i = 1; + } + for (; i < nsegs; i++) { desc = &sc->ale_cdata.ale_tx_ring[prod]; desc->addr = htole64(txsegs[i].ds_addr); desc->len = htole32(ALE_TX_BYTES(txsegs[i].ds_len) | vtag); From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 01:00:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75CEA1065679; Tue, 27 Apr 2010 01:00:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 650D08FC22; Tue, 27 Apr 2010 01:00: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 o3R10MER052420; Tue, 27 Apr 2010 01:00:22 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3R10MPe052418; Tue, 27 Apr 2010 01:00:22 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201004270100.o3R10MPe052418@svn.freebsd.org> From: Rick Macklem Date: Tue, 27 Apr 2010 01:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207256 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 01:00:22 -0000 Author: rmacklem Date: Tue Apr 27 01:00:22 2010 New Revision: 207256 URL: http://svn.freebsd.org/changeset/base/207256 Log: MFC: r206880 For the experimental NFS client doing an NFSv4 mount, set the NFSCLFLAGS_RECVRINPROG while doing recovery from an expired lease in a manner similar to r206818 for server reboot recovery. This will prevent the function that acquires stateids for I/O operations from acquiring out of date stateids during recovery. Also, fix up mutex locking on the nfsc_flags field. Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clstate.c Tue Apr 27 00:58:19 2010 (r207255) +++ stable/8/sys/fs/nfsclient/nfs_clstate.c Tue Apr 27 01:00:22 2010 (r207256) @@ -2111,6 +2111,7 @@ nfscl_hasexpired(struct nfsclclient *clp NFSUNLOCKCLSTATE(); return (0); } + clp->nfsc_flags |= NFSCLFLAGS_RECVRINPROG; NFSUNLOCKCLSTATE(); nmp = clp->nfsc_nmp; @@ -2127,6 +2128,7 @@ nfscl_hasexpired(struct nfsclclient *clp * Clear out any state. */ nfscl_cleanclient(clp); + NFSLOCKCLSTATE(); clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID | NFSCLFLAGS_RECOVER); } else { @@ -2140,14 +2142,15 @@ nfscl_hasexpired(struct nfsclclient *clp * Expire the state for the client. */ nfscl_expireclient(clp, nmp, cred, p); + NFSLOCKCLSTATE(); clp->nfsc_flags |= NFSCLFLAGS_HASCLIENTID; clp->nfsc_flags &= ~NFSCLFLAGS_RECOVER; } - NFSFREECRED(cred); - clp->nfsc_flags &= ~NFSCLFLAGS_EXPIREIT; - NFSLOCKCLSTATE(); + clp->nfsc_flags &= ~(NFSCLFLAGS_EXPIREIT | NFSCLFLAGS_RECVRINPROG); + wakeup(&clp->nfsc_flags); nfsv4_unlock(&clp->nfsc_lock, 0); NFSUNLOCKCLSTATE(); + NFSFREECRED(cred); return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 03:52:28 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7650D106566B; Tue, 27 Apr 2010 03:52:28 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id E27C68FC08; Tue, 27 Apr 2010 03:52:27 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.4/8.14.4) with ESMTP id o3R3qPmf087655; Tue, 27 Apr 2010 07:52:26 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1272340346; bh=EpKidt0oNXub3YWtmChsC6H8uvY2Kd+Qn4O6j/A5bQ8=; l=558; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=rzeE6jkM0/MSinqDMIjUplK7XlrkjSeQwqt/XumMMK3MtcFQl+hZPhfkjkq917ArQ ud927brIAX2GaEO49oEB13YRUHIEcNRQ5ZUPGBMdGBSN1kJIBowlyf8ONpbyFiQtkc RXvm8InOdoAKwiySwIkCbwuVQCf6z/vKJPnta4JA= Received: (from ache@localhost) by nagual.pp.ru (8.14.4/8.14.4/Submit) id o3R3qPwi087654; Tue, 27 Apr 2010 07:52:25 +0400 (MSD) (envelope-from ache) Date: Tue, 27 Apr 2010 07:52:25 +0400 From: Andrey Chernov To: Jilles Tjoelker Message-ID: <20100427035224.GA87611@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Jilles Tjoelker , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201004252043.o3PKhJi7065713@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201004252043.o3PKhJi7065713@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r207206 - 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: Tue, 27 Apr 2010 03:52:28 -0000 On Sun, Apr 25, 2010 at 08:43:19PM +0000, Jilles Tjoelker wrote: > Author: jilles > Date: Sun Apr 25 20:43:19 2010 > New Revision: 207206 > URL: http://svn.freebsd.org/changeset/base/207206 > > Log: > sh: Use stalloc for arith variable names. > > This is simpler than the custom memory tracker I added earlier, and is also > needed by the dash arith code I plan to import. Just wonder, do you have plans to implement ${!variable} sometimes? This bashism is very useful: VAR_a1=foo x=VAR_a1 echo ${!x} -- http://ache.pp.ru/ From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 05:04:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AC3B1065672; Tue, 27 Apr 2010 05:04:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 681328FC15; Tue, 27 Apr 2010 05:04: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 o3R54X3r006746; Tue, 27 Apr 2010 05:04:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3R54Xu0006743; Tue, 27 Apr 2010 05:04:33 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004270504.o3R54Xu0006743@svn.freebsd.org> From: Warner Losh Date: Tue, 27 Apr 2010 05:04: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: r207260 - head/usr.sbin/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 05:04:33 -0000 Author: imp Date: Tue Apr 27 05:04:32 2010 New Revision: 207260 URL: http://svn.freebsd.org/changeset/base/207260 Log: Move checking the version up from Makefile generation to just after we've parsed the config file. Makefile generation is too late if we've introduce changes to the syntax of the metafiles to warn about version skew, since we have to try to parse them and we get an parse error that's rather baffling to the user rather than a 'your config is too old, upgrade' which we should get. We have to defer doing it until after we've read the user's config file because we define machinename there. The version required to compile the kernel is encoded in Makefile.machinename. There's no real reason for this to be the case, but changing it now would introduce some logistical issues that I'd rather avoid for the moment. I intend to revisit this if we're still using config in FreeBSD 10. This also means that we cannot introduce any config metafile changes that result in a syntax error or other error for the user until 9.0 is released. Otherwise, we break the upgrade path, or at least reduce the usefulness of the error messages we generate. # This implies that the config file option mapping will need to be redone. MFC after: 3 days Modified: head/usr.sbin/config/config.h head/usr.sbin/config/main.c head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/config.h ============================================================================== --- head/usr.sbin/config/config.h Tue Apr 27 02:52:19 2010 (r207259) +++ head/usr.sbin/config/config.h Tue Apr 27 05:04:32 2010 (r207260) @@ -179,6 +179,7 @@ void makehints(void); void headers(void); void cfgfile_add(const char *); void cfgfile_removeall(void); +FILE *open_makefile_template(void); extern STAILQ_HEAD(device_head, device) dtab; Modified: head/usr.sbin/config/main.c ============================================================================== --- head/usr.sbin/config/main.c Tue Apr 27 02:52:19 2010 (r207259) +++ head/usr.sbin/config/main.c Tue Apr 27 05:04:32 2010 (r207260) @@ -90,6 +90,7 @@ static void get_srcdir(void); static void usage(void); static void cleanheaders(char *); static void kernconfdump(const char *); +static void checkversion(void); struct hdr_list { char *h_name; @@ -204,6 +205,7 @@ main(int argc, char **argv) printf("cpu type must be specified\n"); exit(1); } + checkversion(); /* * make symbolic links in compilation directory @@ -721,3 +723,41 @@ kernconfdump(const char *file) } fclose(fp); } + +static void +badversion(int versreq) +{ + fprintf(stderr, "ERROR: version of config(8) does not match kernel!\n"); + fprintf(stderr, "config version = %d, ", CONFIGVERS); + fprintf(stderr, "version required = %d\n\n", versreq); + fprintf(stderr, "Make sure that /usr/src/usr.sbin/config is in sync\n"); + fprintf(stderr, "with your /usr/src/sys and install a new config binary\n"); + fprintf(stderr, "before trying this again.\n\n"); + fprintf(stderr, "If running the new config fails check your config\n"); + fprintf(stderr, "file against the GENERIC or LINT config files for\n"); + fprintf(stderr, "changes in config syntax, or option/device naming\n"); + fprintf(stderr, "conventions\n\n"); + exit(1); +} + +static void +checkversion(void) +{ + FILE *ifp; + char line[BUFSIZ]; + int versreq; + + ifp = open_makefile_template(); + while (fgets(line, BUFSIZ, ifp) != 0) { + if (*line != '%') + continue; + if (strncmp(line, "%VERSREQ=", 9) != 0) + continue; + versreq = atoi(line + 9); + if (MAJOR_VERS(versreq) == MAJOR_VERS(CONFIGVERS) && + versreq <= CONFIGVERS) + continue; + badversion(versreq); + } + fclose(ifp); +} Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Tue Apr 27 02:52:19 2010 (r207259) +++ head/usr.sbin/config/mkmakefile.c Tue Apr 27 05:04:32 2010 (r207260) @@ -105,17 +105,14 @@ new_fent(void) } /* - * Build the makefile from the skeleton + * Open the correct Makefile and return it, or error out. */ -void -makefile(void) +FILE * +open_makefile_template(void) { - FILE *ifp, *ofp; + FILE *ifp; char line[BUFSIZ]; - struct opt *op, *t; - int versreq; - read_files(); snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); ifp = fopen(line, "r"); if (ifp == 0) { @@ -124,7 +121,21 @@ makefile(void) } if (ifp == 0) err(1, "%s", line); + return (ifp); +} +/* + * Build the makefile from the skeleton + */ +void +makefile(void) +{ + FILE *ifp, *ofp; + char line[BUFSIZ]; + struct opt *op, *t; + + read_files(); + ifp = open_makefile_template(); ofp = fopen(path("Makefile.new"), "w"); if (ofp == 0) err(1, "%s", path("Makefile.new")); @@ -156,23 +167,9 @@ makefile(void) do_rules(ofp); else if (eq(line, "%CLEAN\n")) do_clean(ofp); - else if (strncmp(line, "%VERSREQ=", sizeof("%VERSREQ=") - 1) == 0) { - versreq = atoi(line + sizeof("%VERSREQ=") - 1); - if (MAJOR_VERS(versreq) != MAJOR_VERS(CONFIGVERS) || - versreq > CONFIGVERS) { - fprintf(stderr, "ERROR: version of config(8) does not match kernel!\n"); - fprintf(stderr, "config version = %d, ", CONFIGVERS); - fprintf(stderr, "version required = %d\n\n", versreq); - fprintf(stderr, "Make sure that /usr/src/usr.sbin/config is in sync\n"); - fprintf(stderr, "with your /usr/src/sys and install a new config binary\n"); - fprintf(stderr, "before trying this again.\n\n"); - fprintf(stderr, "If running the new config fails check your config\n"); - fprintf(stderr, "file against the GENERIC or LINT config files for\n"); - fprintf(stderr, "changes in config syntax, or option/device naming\n"); - fprintf(stderr, "conventions\n\n"); - exit(1); - } - } else + else if (strncmp(line, "%VERSREQ=", 9) == 0) + line[0] = '\0'; /* handled elsewhere */ + else fprintf(stderr, "Unknown %% construct in generic makefile: %s", line); From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 05:35:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72F101065673; Tue, 27 Apr 2010 05:35:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 617588FC0C; Tue, 27 Apr 2010 05:35:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3R5ZaKA013749; Tue, 27 Apr 2010 05:35:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3R5Zafj013748; Tue, 27 Apr 2010 05:35:36 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004270535.o3R5Zafj013748@svn.freebsd.org> From: Alan Cox Date: Tue, 27 Apr 2010 05:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207262 - head/sys/i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 05:35:36 -0000 Author: alc Date: Tue Apr 27 05:35:35 2010 New Revision: 207262 URL: http://svn.freebsd.org/changeset/base/207262 Log: MFi386 r207205 Clearing a page table entry's accessed bit (PG_A) and setting the page's PG_REFERENCED flag in pmap_protect() can't really be justified, so don't do it. Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Tue Apr 27 05:18:02 2010 (r207261) +++ head/sys/i386/xen/pmap.c Tue Apr 27 05:35:35 2010 (r207262) @@ -2600,22 +2600,16 @@ retry: obits = pbits = *pte; if ((pbits & PG_V) == 0) continue; - if (pbits & PG_MANAGED) { - m = NULL; - if (pbits & PG_A) { - m = PHYS_TO_VM_PAGE(xpmap_mtop(pbits) & PG_FRAME); - vm_page_flag_set(m, PG_REFERENCED); - pbits &= ~PG_A; - } - if ((pbits & PG_M) != 0) { - if (m == NULL) - m = PHYS_TO_VM_PAGE(xpmap_mtop(pbits) & PG_FRAME); + + if ((prot & VM_PROT_WRITE) == 0) { + if ((pbits & (PG_MANAGED | PG_M | PG_RW)) == + (PG_MANAGED | PG_M | PG_RW)) { + m = PHYS_TO_VM_PAGE(xpmap_mtop(pbits) & + PG_FRAME); vm_page_dirty(m); } - } - - if ((prot & VM_PROT_WRITE) == 0) pbits &= ~(PG_RW | PG_M); + } #ifdef PAE if ((prot & VM_PROT_EXECUTE) == 0) pbits |= pg_nx; From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 05:38:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26F72106566C; Tue, 27 Apr 2010 05:38:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 149B88FC1C; Tue, 27 Apr 2010 05:38: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 o3R5cQ4p014416; Tue, 27 Apr 2010 05:38:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3R5cQUa014413; Tue, 27 Apr 2010 05:38:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004270538.o3R5cQUa014413@svn.freebsd.org> From: Warner Losh Date: Tue, 27 Apr 2010 05:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207263 - head/usr.sbin/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 05:38:27 -0000 Author: imp Date: Tue Apr 27 05:38:26 2010 New Revision: 207263 URL: http://svn.freebsd.org/changeset/base/207263 Log: Redo how we add compat options so as to be compatible with old versions of config. Remove support for the syntax OLD = NEW form the options file, and instead have a new file $S/conf/options-compat. This file will be parsed as OLD NEW on each line. Bump version of config. Since nothing in -current ever used this, there's no hazards for current users, so I'm not bumping the version in the Makefiles.$MACHINE. No need, really, for this version bump in -current, but this was introduced into -stable before I realized the version check was ineffective there, so the verison bump doesn't hurt here and keeps the two branches in sync, versionwise, after the MFC. MFC after: 3 days Modified: head/usr.sbin/config/configvers.h head/usr.sbin/config/mkoptions.c Modified: head/usr.sbin/config/configvers.h ============================================================================== --- head/usr.sbin/config/configvers.h Tue Apr 27 05:35:35 2010 (r207262) +++ head/usr.sbin/config/configvers.h Tue Apr 27 05:38:26 2010 (r207263) @@ -49,5 +49,5 @@ * * $FreeBSD$ */ -#define CONFIGVERS 600008 +#define CONFIGVERS 600009 #define MAJOR_VERS(x) ((x) / 100000) Modified: head/usr.sbin/config/mkoptions.c ============================================================================== --- head/usr.sbin/config/mkoptions.c Tue Apr 27 05:35:35 2010 (r207262) +++ head/usr.sbin/config/mkoptions.c Tue Apr 27 05:38:26 2010 (r207263) @@ -166,7 +166,7 @@ do_option(char *name) fprintf(outf, "#define %s %s\n", name, value); } /* else empty file */ - (void) fclose(outf); + (void)fclose(outf); return; } basefile = ""; @@ -225,7 +225,7 @@ do_option(char *name) if (cp == (char *)EOF) break; } - (void) fclose(inf); + (void)fclose(inf); if (!tidy && ((value == NULL && oldvalue == NULL) || (value && oldvalue && eq(value, oldvalue)))) { while (!SLIST_EMPTY(&op_head)) { @@ -263,7 +263,7 @@ do_option(char *name) free(op->op_value); free(op); } - (void) fclose(outf); + (void)fclose(outf); } /* @@ -277,7 +277,7 @@ tooption(char *name) struct opt_list *po; /* "cannot happen"? the otab list should be complete.. */ - (void) strlcpy(nbuf, "options.h", sizeof(nbuf)); + (void)strlcpy(nbuf, "options.h", sizeof(nbuf)); SLIST_FOREACH(po, &otab, o_next) { if (eq(po->o_name, name)) { @@ -286,78 +286,30 @@ tooption(char *name) } } - (void) strlcpy(hbuf, path(nbuf), sizeof(hbuf)); + (void)strlcpy(hbuf, path(nbuf), sizeof(hbuf)); return (hbuf); } -/* - * read the options and options. files - */ + static void -read_options(void) +insert_option(char *this, char *val, int flags) { - FILE *fp; - char fname[MAXPATHLEN]; - char *wd, *this, *val; struct opt_list *po; - int first = 1; - char genopt[MAXPATHLEN]; - int flags = 0; - SLIST_INIT(&otab); - (void) snprintf(fname, sizeof(fname), "../../conf/options"); -openit: - fp = fopen(fname, "r"); - if (fp == 0) { - return; - } -next: - flags = 0; - wd = get_word(fp); - if (wd == (char *)EOF) { - (void) fclose(fp); - if (first == 1) { - first++; - (void) snprintf(fname, sizeof fname, "../../conf/options.%s", machinename); - fp = fopen(fname, "r"); - if (fp != 0) - goto next; - (void) snprintf(fname, sizeof fname, "options.%s", machinename); - goto openit; - } - return; - } - if (wd == 0) - goto next; - if (wd[0] == '#') - { - while (((wd = get_word(fp)) != (char *)EOF) && wd) - ; - goto next; - } - this = ns(wd); - val = get_word(fp); - if (val == (char *)EOF) - return; - if (val == 0) { - char *s = ns(this); - (void) snprintf(genopt, sizeof(genopt), "opt_%s.h", lower(s)); - val = genopt; - free(s); - } else if (eq(val, "=")) { - val = get_word(fp); - if (val == (char *)EOF) { - printf("%s: unexpected end of file\n", fname); - exit(1); - } - if (val == 0) { - printf("%s: Expected a right hand side at %s\n", fname, - this); - exit(1); - } - flags |= OL_ALIAS; - } - val = ns(val); + po = (struct opt_list *) calloc(1, sizeof *po); + if (po == NULL) + err(EXIT_FAILURE, "calloc"); + po->o_name = this; + po->o_file = val; + po->o_flags = flags; + SLIST_INSERT_HEAD(&otab, po, o_next); +} + + +static void +check_duplicate(const char *fname, const char *this) +{ + struct opt_list *po; SLIST_FOREACH(po, &otab, o_next) { if (eq(po->o_name, this)) { @@ -366,16 +318,67 @@ next: exit(1); } } - - po = (struct opt_list *) calloc(1, sizeof *po); - if (po == NULL) - err(EXIT_FAILURE, "calloc"); - po->o_name = this; - po->o_file = val; - po->o_flags = flags; - SLIST_INSERT_HEAD(&otab, po, o_next); +} + +static int +read_option_file(const char *fname, int flags) +{ + FILE *fp; + char *wd, *this, *val; + char genopt[MAXPATHLEN]; - goto next; + fp = fopen(fname, "r"); + if (fp == 0) + return (0); + while ((wd = get_word(fp)) != (char *)EOF) { + if (wd == 0) + continue; + if (wd[0] == '#') { + while (((wd = get_word(fp)) != (char *)EOF) && wd) + continue; + continue; + } + this = ns(wd); + val = get_word(fp); + if (val == (char *)EOF) + return (1); + if (val == 0) { + if (flags) { + printf("%s: compat file requires two words " + "per line at %s\n", fname, this); + exit(1); + } + char *s = ns(this); + (void)snprintf(genopt, sizeof(genopt), "opt_%s.h", + lower(s)); + val = genopt; + free(s); + } + val = ns(val); + check_duplicate(fname, this); + insert_option(this, val, flags); + } + (void)fclose(fp); + return (1); +} + +/* + * read the options and options. files + */ +static void +read_options(void) +{ + char fname[MAXPATHLEN]; + + SLIST_INIT(&otab); + read_option_file("../../conf/options", 0); + (void)snprintf(fname, sizeof fname, "../../conf/options.%s", + machinename); + if (!read_option_file(fname, 0)) { + (void)snprintf(fname, sizeof fname, "options.%s", machinename); + read_option_file(fname, 0); + } + read_option_file("../../conf/options-compat", OL_ALIAS); } static char * From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 06:14:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C27F1065670; Tue, 27 Apr 2010 06:14:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6E4E8FC08; Tue, 27 Apr 2010 06:14:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3R6EUhZ022398; Tue, 27 Apr 2010 06:14:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3R6EU2A022396; Tue, 27 Apr 2010 06:14:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201004270614.o3R6EU2A022396@svn.freebsd.org> From: Warner Losh Date: Tue, 27 Apr 2010 06:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207265 - head/usr.sbin/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 06:14:31 -0000 Author: imp Date: Tue Apr 27 06:14:30 2010 New Revision: 207265 URL: http://svn.freebsd.org/changeset/base/207265 Log: Require the option that's mapped be listed in the options file. This will allow people with old config options to either have it just work (if config is new enough), or get a version error (if their config is about 7.0 or newer) rather than getting a cryptic error about duplicated options in the options file, or getting an error about an unknown option, at which point they'd update their config file only to learn they need a new config, only to learn they didn't really need to update their config file... All this because our version checking was in the wrong place for the past decade... # hopefully this is the last change, and we'll be able to config with an # 8.0 GENERIC file on stable/8 after I merge this change and add the # compat options. MFC after: 3 days Modified: head/usr.sbin/config/mkoptions.c Modified: head/usr.sbin/config/mkoptions.c ============================================================================== --- head/usr.sbin/config/mkoptions.c Tue Apr 27 05:39:13 2010 (r207264) +++ head/usr.sbin/config/mkoptions.c Tue Apr 27 06:14:30 2010 (r207265) @@ -292,32 +292,49 @@ tooption(char *name) static void -insert_option(char *this, char *val, int flags) +check_duplicate(const char *fname, const char *this) { struct opt_list *po; + SLIST_FOREACH(po, &otab, o_next) { + if (eq(po->o_name, this)) { + printf("%s: Duplicate option %s.\n", + fname, this); + exit(1); + } + } +} + +static void +insert_option(const char *fname, char *this, char *val) +{ + struct opt_list *po; + + check_duplicate(fname, this); po = (struct opt_list *) calloc(1, sizeof *po); if (po == NULL) err(EXIT_FAILURE, "calloc"); po->o_name = this; po->o_file = val; - po->o_flags = flags; + po->o_flags = 0; SLIST_INSERT_HEAD(&otab, po, o_next); } - static void -check_duplicate(const char *fname, const char *this) +update_option(const char *this, char *val, int flags) { struct opt_list *po; SLIST_FOREACH(po, &otab, o_next) { if (eq(po->o_name, this)) { - printf("%s: Duplicate option %s.\n", - fname, this); - exit(1); + free(po->o_file); + po->o_file = val; + po->o_flags = flags; + return; } } + printf("Compat option %s not listed in options file.\n", this); + exit(1); } static int @@ -355,8 +372,10 @@ read_option_file(const char *fname, int free(s); } val = ns(val); - check_duplicate(fname, this); - insert_option(this, val, flags); + if (flags == 0) + insert_option(fname, this, val); + else + update_option(this, val, flags); } (void)fclose(fp); return (1); From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 09:47:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DEAC106566C; Tue, 27 Apr 2010 09:47:15 +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 4E2518FC1E; Tue, 27 Apr 2010 09:47: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 o3R9lEuM069504; Tue, 27 Apr 2010 09:47:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3R9lEUt069503; Tue, 27 Apr 2010 09:47:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004270947.o3R9lEUt069503@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Apr 2010 09:47: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: r207268 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 09:47:15 -0000 Author: kib Date: Tue Apr 27 09:47:14 2010 New Revision: 207268 URL: http://svn.freebsd.org/changeset/base/207268 Log: Provide 32bit compat for SIOCGDEFIFACE_IN6. Based on submission by: pluknet gmail com Reviewed by: emaste MFC after: 2 weeks Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Apr 27 07:34:20 2010 (r207267) +++ head/sys/netinet6/in6.c Tue Apr 27 09:47:14 2010 (r207268) @@ -63,6 +63,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -176,6 +177,14 @@ in6_mask2len(struct in6_addr *mask, u_ch #define ifa2ia6(ifa) ((struct in6_ifaddr *)(ifa)) #define ia62ifa(ia6) (&((ia6)->ia_ifa)) +#ifdef COMPAT_FREEBSD32 +struct in6_ndifreq32 { + char ifname[IFNAMSIZ]; + uint32_t ifindex; +}; +#define SIOCGDEFIFACE32_IN6 _IOWR('i', 86, struct in6_ndifreq32) +#endif + int in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) @@ -226,6 +235,22 @@ in6_control(struct socket *so, u_long cm case SIOCGNBRINFO_IN6: case SIOCGDEFIFACE_IN6: return (nd6_ioctl(cmd, data, ifp)); + +#ifdef COMPAT_FREEBSD32 + case SIOCGDEFIFACE32_IN6: + { + struct in6_ndifreq ndif; + struct in6_ndifreq32 *ndif32; + + error = nd6_ioctl(SIOCGDEFIFACE_IN6, (caddr_t)&ndif, + ifp); + if (error) + return (error); + ndif32 = (struct in6_ndifreq32 *)data; + ndif32->ifindex = ndif.ifindex; + return (0); + } +#endif } switch (cmd) { From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 09:48:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36361106566B; Tue, 27 Apr 2010 09:48: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 2484B8FC21; Tue, 27 Apr 2010 09:48: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 o3R9mi1E069869; Tue, 27 Apr 2010 09:48:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3R9mhWG069860; Tue, 27 Apr 2010 09:48:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004270948.o3R9mhWG069860@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Apr 2010 09:48: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: r207269 - 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: Tue, 27 Apr 2010 09:48:44 -0000 Author: kib Date: Tue Apr 27 09:48:43 2010 New Revision: 207269 URL: http://svn.freebsd.org/changeset/base/207269 Log: Style: use #define instead of #define. Noted by: bde, pluknet gmail com MFC after: 11 days Modified: head/sys/amd64/include/proc.h head/sys/arm/include/proc.h head/sys/i386/include/proc.h head/sys/ia64/include/proc.h head/sys/mips/include/proc.h head/sys/powerpc/include/proc.h head/sys/sparc64/include/proc.h head/sys/sun4v/include/proc.h Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Tue Apr 27 09:47:14 2010 (r207268) +++ head/sys/amd64/include/proc.h Tue Apr 27 09:48:43 2010 (r207269) @@ -53,8 +53,8 @@ struct mdproc { struct system_segment_descriptor md_ldt_sd; }; -#define KINFO_PROC_SIZE 1088 -#define KINFO_PROC32_SIZE 768 +#define KINFO_PROC_SIZE 1088 +#define KINFO_PROC32_SIZE 768 #ifdef _KERNEL Modified: head/sys/arm/include/proc.h ============================================================================== --- head/sys/arm/include/proc.h Tue Apr 27 09:47:14 2010 (r207268) +++ head/sys/arm/include/proc.h Tue Apr 27 09:48:43 2010 (r207269) @@ -60,6 +60,6 @@ struct mdproc { void *md_sigtramp; }; -#define KINFO_PROC_SIZE 792 +#define KINFO_PROC_SIZE 792 #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/i386/include/proc.h ============================================================================== --- head/sys/i386/include/proc.h Tue Apr 27 09:47:14 2010 (r207268) +++ head/sys/i386/include/proc.h Tue Apr 27 09:48:43 2010 (r207269) @@ -57,7 +57,7 @@ struct mdproc { struct proc_ldt *md_ldt; /* (t) per-process ldt */ }; -#define KINFO_PROC_SIZE 768 +#define KINFO_PROC_SIZE 768 #ifdef _KERNEL Modified: head/sys/ia64/include/proc.h ============================================================================== --- head/sys/ia64/include/proc.h Tue Apr 27 09:47:14 2010 (r207268) +++ head/sys/ia64/include/proc.h Tue Apr 27 09:48:43 2010 (r207269) @@ -38,7 +38,7 @@ struct mdproc { int __dummy; /* Avoid having an empty struct. */ }; -#define KINFO_PROC_SIZE 1088 -#define KINFO_PROC32_SIZE 768 +#define KINFO_PROC_SIZE 1088 +#define KINFO_PROC32_SIZE 768 #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/mips/include/proc.h ============================================================================== --- head/sys/mips/include/proc.h Tue Apr 27 09:47:14 2010 (r207268) +++ head/sys/mips/include/proc.h Tue Apr 27 09:48:43 2010 (r207269) @@ -69,9 +69,9 @@ void mips_cpu_switch(struct thread *, st void mips_cpu_throw(struct thread *, struct thread *); #ifdef __mips_n64 -#define KINFO_PROC_SIZE 1088 +#define KINFO_PROC_SIZE 1088 #else -#define KINFO_PROC_SIZE 816 +#define KINFO_PROC_SIZE 816 #endif #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/powerpc/include/proc.h ============================================================================== --- head/sys/powerpc/include/proc.h Tue Apr 27 09:47:14 2010 (r207268) +++ head/sys/powerpc/include/proc.h Tue Apr 27 09:48:43 2010 (r207269) @@ -46,6 +46,6 @@ struct mdthread { struct mdproc { }; -#define KINFO_PROC_SIZE 768 +#define KINFO_PROC_SIZE 768 #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/sparc64/include/proc.h ============================================================================== --- head/sys/sparc64/include/proc.h Tue Apr 27 09:47:14 2010 (r207268) +++ head/sys/sparc64/include/proc.h Tue Apr 27 09:48:43 2010 (r207269) @@ -51,6 +51,6 @@ struct mdproc { void *md_sigtramp; }; -#define KINFO_PROC_SIZE 1088 +#define KINFO_PROC_SIZE 1088 #endif /* !_MACHINE_PROC_H_ */ Modified: head/sys/sun4v/include/proc.h ============================================================================== --- head/sys/sun4v/include/proc.h Tue Apr 27 09:47:14 2010 (r207268) +++ head/sys/sun4v/include/proc.h Tue Apr 27 09:48:43 2010 (r207269) @@ -51,6 +51,6 @@ struct mdproc { void *md_sigtramp; }; -#define KINFO_PROC_SIZE 1088 +#define KINFO_PROC_SIZE 1088 #endif /* !_MACHINE_PROC_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 10:47:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AC76106564A; Tue, 27 Apr 2010 10:47:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A2128FC13; Tue, 27 Apr 2010 10:47: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 o3RAls8S085353; Tue, 27 Apr 2010 10:47:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RAlsfe085351; Tue, 27 Apr 2010 10:47:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004271047.o3RAlsfe085351@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Apr 2010 10:47: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: r207270 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 10:47:54 -0000 Author: kib Date: Tue Apr 27 10:47:54 2010 New Revision: 207270 URL: http://svn.freebsd.org/changeset/base/207270 Log: MFC r206547: Handle a case in kern_openat() when vn_open() change file type from DTYPE_VNODE. Modified: stable/8/sys/kern/vfs_syscalls.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/vfs_syscalls.c ============================================================================== --- stable/8/sys/kern/vfs_syscalls.c Tue Apr 27 09:48:43 2010 (r207269) +++ stable/8/sys/kern/vfs_syscalls.c Tue Apr 27 10:47:54 2010 (r207270) @@ -1047,8 +1047,6 @@ kern_openat(struct thread *td, int fd, c struct filedesc *fdp = p->p_fd; struct file *fp; struct vnode *vp; - struct vattr vat; - struct mount *mp; int cmode; struct file *nfp; int type, indx, error; @@ -1141,7 +1139,7 @@ kern_openat(struct thread *td, int fd, c } VOP_UNLOCK(vp, 0); - if (flags & (O_EXLOCK | O_SHLOCK)) { + if (fp->f_type == DTYPE_VNODE && (flags & (O_EXLOCK | O_SHLOCK)) != 0) { lf.l_whence = SEEK_SET; lf.l_start = 0; lf.l_len = 0; @@ -1158,18 +1156,7 @@ kern_openat(struct thread *td, int fd, c atomic_set_int(&fp->f_flag, FHASLOCK); } if (flags & O_TRUNC) { - if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) - goto bad; - VATTR_NULL(&vat); - vat.va_size = 0; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); -#ifdef MAC - error = mac_vnode_check_write(td->td_ucred, fp->f_cred, vp); - if (error == 0) -#endif - error = VOP_SETATTR(vp, &vat, td->td_ucred); - VOP_UNLOCK(vp, 0); - vn_finished_write(mp); + error = fo_truncate(fp, 0, td->td_ucred, td); if (error) goto bad; } From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 10:50:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1627106564A; Tue, 27 Apr 2010 10:50:09 +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 90F478FC0C; Tue, 27 Apr 2010 10:50:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3RAo9kG085896; Tue, 27 Apr 2010 10:50:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RAo9Kj085894; Tue, 27 Apr 2010 10:50:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004271050.o3RAo9Kj085894@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 27 Apr 2010 10:50:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207271 - stable/8/sys/amd64/ia32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Apr 2010 10:50:09 -0000 Author: kib Date: Tue Apr 27 10:50:09 2010 New Revision: 207271 URL: http://svn.freebsd.org/changeset/base/207271 Log: MFC r206992: As was done in r155238 for i386 and in r155239 for amd64, clear the carry flag for ia32 binary executed on amd64 host in get_mcontext(). Modified: stable/8/sys/amd64/ia32/ia32_signal.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/amd64/ia32/ia32_signal.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_signal.c Tue Apr 27 10:47:54 2010 (r207270) +++ stable/8/sys/amd64/ia32/ia32_signal.c Tue Apr 27 10:50:09 2010 (r207271) @@ -141,9 +141,11 @@ ia32_get_mcontext(struct thread *td, str mcp->mc_esi = tp->tf_rsi; mcp->mc_ebp = tp->tf_rbp; mcp->mc_isp = tp->tf_rsp; + mcp->mc_eflags = tp->tf_rflags; if (flags & GET_MC_CLEAR_RET) { mcp->mc_eax = 0; mcp->mc_edx = 0; + mcp->mc_eflags &= ~PSL_C; } else { mcp->mc_eax = tp->tf_rax; mcp->mc_edx = tp->tf_rdx; @@ -152,7 +154,6 @@ ia32_get_mcontext(struct thread *td, str mcp->mc_ecx = tp->tf_rcx; mcp->mc_eip = tp->tf_rip; mcp->mc_cs = tp->tf_cs; - mcp->mc_eflags = tp->tf_rflags; mcp->mc_esp = tp->tf_rsp; mcp->mc_ss = tp->tf_ss; mcp->mc_len = sizeof(*mcp); From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 12:50:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01509106568F; Tue, 27 Apr 2010 12:50:43 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4B838FC0A; Tue, 27 Apr 2010 12:50: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 o3RCogx9012538; Tue, 27 Apr 2010 12:50:42 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RCogn7012537; Tue, 27 Apr 2010 12:50:42 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201004271250.o3RCogn7012537@svn.freebsd.org> From: Nick Hibma Date: Tue, 27 Apr 2010 12:50:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207272 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 12:50:43 -0000 Author: n_hibma Date: Tue Apr 27 12:50:42 2010 New Revision: 207272 URL: http://svn.freebsd.org/changeset/base/207272 Log: Typo in comment. Modified: stable/7/sys/dev/usb/uhub.c Modified: stable/7/sys/dev/usb/uhub.c ============================================================================== --- stable/7/sys/dev/usb/uhub.c Tue Apr 27 10:50:09 2010 (r207271) +++ stable/7/sys/dev/usb/uhub.c Tue Apr 27 12:50:42 2010 (r207272) @@ -435,7 +435,7 @@ uhub_explore(usbd_device_handle dev) #if 0 && defined(DIAGNOSTIC) if (up->device == NULL && (status & UPS_CURRENT_CONNECT_STATUS)) - deivce_printf(sc->sc_dev, + device_printf(sc->sc_dev, "connected, no device\n"); #endif continue; From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 13:27:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3304D1065676; Tue, 27 Apr 2010 13:27:52 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 221958FC29; Tue, 27 Apr 2010 13:27: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 o3RDRqXX020770; Tue, 27 Apr 2010 13:27:52 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RDRq4D020768; Tue, 27 Apr 2010 13:27:52 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201004271327.o3RDRq4D020768@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 27 Apr 2010 13:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207273 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 13:27:52 -0000 Author: bms Date: Tue Apr 27 13:27:51 2010 New Revision: 207273 URL: http://svn.freebsd.org/changeset/base/207273 Log: MFC 206454: When embedding the scope ID in MLDv1 output, check if the scope of the address being embedded is in fact link-local, before attempting to embed it. Note that this operation is a side-effect of trying to avoid recursion on the IN6 scope lock. PR: 144560 Submitted by: Petr Lampa Modified: stable/8/sys/netinet6/mld6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netinet6/mld6.c ============================================================================== --- stable/8/sys/netinet6/mld6.c Tue Apr 27 12:50:42 2010 (r207272) +++ stable/8/sys/netinet6/mld6.c Tue Apr 27 13:27:51 2010 (r207273) @@ -195,8 +195,10 @@ static int sysctl_mld_ifinfo(SYSCTL_HAND static struct mtx mld_mtx; MALLOC_DEFINE(M_MLD, "mld", "mld state"); -#define MLD_EMBEDSCOPE(pin6, zoneid) \ - (pin6)->s6_addr16[1] = htons((zoneid) & 0xFFFF) +#define MLD_EMBEDSCOPE(pin6, zoneid) \ + if (IN6_IS_SCOPE_LINKLOCAL(pin6) || \ + IN6_IS_ADDR_MC_INTFACELOCAL(pin6)) \ + (pin6)->s6_addr16[1] = htons((zoneid) & 0xFFFF) \ /* * VIMAGE-wide globals. From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 13:50:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47F4F1065673; Tue, 27 Apr 2010 13:50:16 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 362BD8FC1D; Tue, 27 Apr 2010 13:50: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 o3RDoGmP025777; Tue, 27 Apr 2010 13:50:16 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RDoGFw025776; Tue, 27 Apr 2010 13:50:16 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201004271350.o3RDoGFw025776@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 27 Apr 2010 13:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207274 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 13:50:16 -0000 Author: bms Date: Tue Apr 27 13:50:15 2010 New Revision: 207274 URL: http://svn.freebsd.org/changeset/base/207274 Log: MFC 206452: Fix a few issues related to the legacy 4.4 BSD multicast APIs. IPv4 addresses can and do change during normal operation. Testing by pfSense developers exposed an issue where OpenOSPFD was using the IPv4 address to leave the OSPF link-scope multicast groups on a dynamic OpenVPN tun interface, rather than using RFC 3678 with the interface index, which won't be raced when the interface's addresses change. In inp_join_group(): If we are already a member of an ASM group, and IP_ADD_MEMBERSHIP or MCAST_JOIN_GROUP ioctls are re-issued, return EADDRINUSE as per the legacy 4.4BSD multicast API. This bends RFC 3678 slightly, but does not violate POLA for apps using the old API. It also stops us falling through to kicking IGMP state transactions in what is otherwise a no-op case. [This has already been dealt with in HEAD, but make it explicit before we MFC the change to 8.] In inp_leave_group(): Fix a bogus conditional. Move the ifp null check to ioctls MCAST_LEAVE* in the switch..case where it actually belongs. If an interface was specified, by primary IPv4 address, for ioctl IP_DROP_MEMBERSHIP or MCAST_LEAVE_GROUP (an ASM full leave operation), then and only then should we look up the ifp from the IPv4 address in mreqs.imr_interface. If not, we fall through to imo_match_group() as before, but only in the IP_DROP_MEMBERSHIP case. With these changes, the legacy 4.4BSD multicast API idempotence should be mostly preserved in the SSM enabled IPv4 stack. [Note: this is not a straight svn merge as head and 8 differ slightly] Found by: ermal (with pfSense) Modified: stable/8/sys/netinet/in_mcast.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netinet/in_mcast.c ============================================================================== --- stable/8/sys/netinet/in_mcast.c Tue Apr 27 13:27:51 2010 (r207273) +++ stable/8/sys/netinet/in_mcast.c Tue Apr 27 13:50:15 2010 (r207274) @@ -1991,6 +1991,17 @@ inp_join_group(struct inpcb *inp, struct error = EINVAL; goto out_inp_locked; } + /* + * MCAST_JOIN_GROUP on an existing exclusive + * membership is an error; return EADDRINUSE + * to preserve 4.4BSD API idempotence, and + * avoid tedious detour to code below. + * NOTE: This is bending RFC 3678 a bit. + */ + if (imf->imf_st[1] == MCAST_EXCLUDE) { + error = EADDRINUSE; + goto out_inp_locked; + } } } @@ -2161,7 +2172,14 @@ inp_leave_group(struct inpcb *inp, struc ssa->sin.sin_addr = mreqs.imr_sourceaddr; } - if (!in_nullhost(gsa->sin.sin_addr)) + /* + * Attempt to look up hinted ifp from interface address. + * Fallthrough with null ifp iff lookup fails, to + * preserve 4.4BSD mcast API idempotence. + * XXX NOTE WELL: The RFC 3678 API is preferred because + * using an IPv4 address as a key is racy. + */ + if (!in_nullhost(mreqs.imr_interface)) INADDR_TO_IFP(mreqs.imr_interface, ifp); CTR3(KTR_IGMPV3, "%s: imr_interface = %s, ifp = %p", @@ -2197,6 +2215,9 @@ inp_leave_group(struct inpcb *inp, struc return (EADDRNOTAVAIL); ifp = ifnet_byindex(gsr.gsr_interface); + + if (ifp == NULL) + return (EADDRNOTAVAIL); break; default: @@ -2209,9 +2230,6 @@ inp_leave_group(struct inpcb *inp, struc if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); - if (ifp == NULL) - return (EADDRNOTAVAIL); - /* * Find the membership in the membership array. */ From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 14:14:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8A7F1065673; Tue, 27 Apr 2010 14:14:21 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 963148FC0C; Tue, 27 Apr 2010 14:14:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3REELYr031094; Tue, 27 Apr 2010 14:14:21 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3REELE9031092; Tue, 27 Apr 2010 14:14:21 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201004271414.o3REELE9031092@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 27 Apr 2010 14:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207275 - 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, 27 Apr 2010 14:14:21 -0000 Author: bms Date: Tue Apr 27 14:14:21 2010 New Revision: 207275 URL: http://svn.freebsd.org/changeset/base/207275 Log: Fix a regression where DVMRP diagnostic traffic, such as that used by mrinfo and mtrace, was dropped by the IGMP TTL check. IGMP control traffic must always have a TTL of 1. Submitted by: Matthew Luckie MFC after: 3 days Modified: head/sys/netinet/igmp.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Tue Apr 27 13:50:15 2010 (r207274) +++ head/sys/netinet/igmp.c Tue Apr 27 14:14:21 2010 (r207275) @@ -1468,12 +1468,6 @@ igmp_input(struct mbuf *m, int off) } ip = mtod(m, struct ip *); - if (ip->ip_ttl != 1) { - IGMPSTAT_INC(igps_rcv_badttl); - m_freem(m); - return; - } - /* * Validate checksum. */ @@ -1488,6 +1482,17 @@ igmp_input(struct mbuf *m, int off) m->m_data -= iphlen; m->m_len += iphlen; + /* + * IGMP control traffic is link-scope, and must have a TTL of 1. + * DVMRP traffic (e.g. mrinfo, mtrace) is an exception; + * probe packets may come from beyond the LAN. + */ + if (igmp->igmp_type != IGMP_DVMRP && ip->ip_ttl != 1) { + IGMPSTAT_INC(igps_rcv_badttl); + m_freem(m); + return; + } + switch (igmp->igmp_type) { case IGMP_HOST_MEMBERSHIP_QUERY: if (igmplen == IGMP_MINLEN) { From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 15:05:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA8DA106567A; Tue, 27 Apr 2010 15:05:03 +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 B89A28FC12; Tue, 27 Apr 2010 15:05:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3RF53aN042320; Tue, 27 Apr 2010 15:05:03 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RF53XS042318; Tue, 27 Apr 2010 15:05:03 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004271505.o3RF53XS042318@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 27 Apr 2010 15:05: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: r207276 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 15:05:03 -0000 Author: bz Date: Tue Apr 27 15:05:03 2010 New Revision: 207276 URL: http://svn.freebsd.org/changeset/base/207276 Log: Make sure IPv6 source address selection does not change interface addresses while walking the IPv6 address list if in the jail case something is connecting to ::1. Reported by: Pieter de Boer (pieter thedarkside.nl) Tested by: Pieter de Boer (pieter thedarkside.nl) MFC after: 4 days Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Tue Apr 27 14:14:21 2010 (r207275) +++ head/sys/netinet6/in6_src.c Tue Apr 27 15:05:03 2010 (r207276) @@ -182,7 +182,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso struct inpcb *inp, struct route_in6 *ro, struct ucred *cred, struct ifnet **ifpp, struct in6_addr *srcp) { - struct in6_addr dst; + struct in6_addr dst, tmp; struct ifnet *ifp = NULL; struct in6_ifaddr *ia = NULL, *ia_best = NULL; struct in6_pktinfo *pi = NULL; @@ -326,10 +326,9 @@ in6_selectsrc(struct sockaddr_in6 *dstso if (!V_ip6_use_deprecated && IFA6_IS_DEPRECATED(ia)) continue; + /* If jailed only take addresses of the jail into account. */ if (cred != NULL && - prison_local_ip6(cred, &ia->ia_addr.sin6_addr, - (inp != NULL && - (inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)) != 0) + prison_check_ip6(cred, &ia->ia_addr.sin6_addr) != 0) continue; /* Rule 1: Prefer same address */ @@ -476,10 +475,26 @@ in6_selectsrc(struct sockaddr_in6 *dstso return (EADDRNOTAVAIL); } + /* + * At this point at least one of the addresses belonged to the jail + * but it could still be, that we want to further restrict it, e.g. + * theoratically IN6_IS_ADDR_LOOPBACK. + * It must not be IN6_IS_ADDR_UNSPECIFIED anymore. + * prison_local_ip6() will fix an IN6_IS_ADDR_LOOPBACK but should + * let all others previously selected pass. + * Use tmp to not change ::1 on lo0 to the primary jail address. + */ + tmp = ia->ia_addr.sin6_addr; + if (cred != NULL && prison_local_ip6(cred, &tmp, (inp != NULL && + (inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)) != 0) { + IN6_IFADDR_RUNLOCK(); + return (EADDRNOTAVAIL); + } + if (ifpp) *ifpp = ifp; - bcopy(&ia->ia_addr.sin6_addr, srcp, sizeof(*srcp)); + bcopy(&tmp, srcp, sizeof(*srcp)); IN6_IFADDR_RUNLOCK(); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 15:07:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F8A41065678; Tue, 27 Apr 2010 15:07:09 +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 1471A8FC17; Tue, 27 Apr 2010 15:07:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3RF78Ef042817; Tue, 27 Apr 2010 15:07:08 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RF78XG042814; Tue, 27 Apr 2010 15:07:08 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004271507.o3RF78XG042814@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 27 Apr 2010 15:07: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: r207277 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 15:07:09 -0000 Author: bz Date: Tue Apr 27 15:07:08 2010 New Revision: 207277 URL: http://svn.freebsd.org/changeset/base/207277 Log: Enhance the historic behaviour of raw sockets and jails in a way that we allow all possible jail IPs as source address rather than forcing the "primary". While IPv6 naturally has source address selection, for legacy IP we do not go through the pain in case IP_HDRINCL was not set. People should bind(2) for that. This will, for example, allow ping(|6) -S to work correctly for non-primary addresses. Reported by: (ten 211.ru) Tested by: (ten 211.ru) MFC after: 4 days Modified: head/sys/netinet/raw_ip.c head/sys/netinet6/raw_ip6.c Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Tue Apr 27 15:05:03 2010 (r207276) +++ head/sys/netinet/raw_ip.c Tue Apr 27 15:07:08 2010 (r207277) @@ -427,11 +427,24 @@ rip_output(struct mbuf *m, struct socket ip->ip_p = inp->inp_ip_p; ip->ip_len = m->m_pkthdr.len; ip->ip_src = inp->inp_laddr; - error = prison_get_ip4(inp->inp_cred, &ip->ip_src); - if (error != 0) { - INP_RUNLOCK(inp); - m_freem(m); - return (error); + if (jailed(inp->inp_cred)) { + /* + * prison_local_ip4() would be good enough but would + * let a source of INADDR_ANY pass, which we do not + * want to see from jails. We do not go through the + * pain of in_pcbladdr() for raw sockets. + */ + if (ip->ip_src.s_addr == INADDR_ANY) + error = prison_get_ip4(inp->inp_cred, + &ip->ip_src); + else + error = prison_local_ip4(inp->inp_cred, + &ip->ip_src); + if (error != 0) { + INP_RUNLOCK(inp); + m_freem(m); + return (error); + } } ip->ip_dst.s_addr = dst; ip->ip_ttl = inp->inp_ip_ttl; Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Tue Apr 27 15:05:03 2010 (r207276) +++ head/sys/netinet6/raw_ip6.c Tue Apr 27 15:07:08 2010 (r207277) @@ -465,7 +465,7 @@ rip6_output(m, va_alist) &oifp, &in6a); if (error) goto bad; - error = prison_get_ip6(in6p->inp_cred, &in6a); + error = prison_check_ip6(in6p->inp_cred, &in6a); if (error != 0) goto bad; ip6->ip6_src = in6a; From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 15:16:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 359821065675; Tue, 27 Apr 2010 15:16:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23BAA8FC0A; Tue, 27 Apr 2010 15:16: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 o3RFGtQ8045007; Tue, 27 Apr 2010 15:16:55 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RFGt8w045005; Tue, 27 Apr 2010 15:16:55 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004271516.o3RFGt8w045005@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 27 Apr 2010 15:16: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: r207278 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 15:16:55 -0000 Author: bz Date: Tue Apr 27 15:16:54 2010 New Revision: 207278 URL: http://svn.freebsd.org/changeset/base/207278 Log: MFP4: @177254 Add missing CURVNET_RESTORE() calls for multiple code paths, to stop leaking the currently cached vnet into callers and to the process. Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH MFC after: 4 days Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Apr 27 15:07:08 2010 (r207277) +++ head/sys/net/bpf.c Tue Apr 27 15:16:54 2010 (r207278) @@ -1454,6 +1454,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c /* FALLSTHROUGH */ default: + CURVNET_RESTORE(); return (EINVAL); } @@ -1461,6 +1462,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c if (d->bd_sbuf != NULL || d->bd_hbuf != NULL || d->bd_fbuf != NULL || d->bd_bif != NULL) { BPFD_UNLOCK(d); + CURVNET_RESTORE(); return (EBUSY); } d->bd_bufmode = *(u_int *)addr; @@ -1468,13 +1470,16 @@ bpfioctl(struct cdev *dev, u_long cmd, c break; case BIOCGETZMAX: - return (bpf_ioctl_getzmax(td, d, (size_t *)addr)); + error = bpf_ioctl_getzmax(td, d, (size_t *)addr); + break; case BIOCSETZBUF: - return (bpf_ioctl_setzbuf(td, d, (struct bpf_zbuf *)addr)); + error = bpf_ioctl_setzbuf(td, d, (struct bpf_zbuf *)addr); + break; case BIOCROTZBUF: - return (bpf_ioctl_rotzbuf(td, d, (struct bpf_zbuf *)addr)); + error = bpf_ioctl_rotzbuf(td, d, (struct bpf_zbuf *)addr); + break; } CURVNET_RESTORE(); return (error); From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 15:38:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07FC9106566C; Tue, 27 Apr 2010 15:38:59 +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 E801D8FC22; Tue, 27 Apr 2010 15:38: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 o3RFcwJH049907; Tue, 27 Apr 2010 15:38:58 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RFcwCb049906; Tue, 27 Apr 2010 15:38:58 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201004271538.o3RFcwCb049906@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 27 Apr 2010 15:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207279 - stable/8/sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Apr 2010 15:38:59 -0000 Author: gallatin Date: Tue Apr 27 15:38:58 2010 New Revision: 207279 URL: http://svn.freebsd.org/changeset/base/207279 Log: MFC 206662: Cleanup if_media handling in mxge(4) Modified: stable/8/sys/dev/mxge/if_mxge.c stable/8/sys/dev/mxge/if_mxge_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/8/sys/dev/mxge/if_mxge.c Tue Apr 27 15:16:54 2010 (r207278) +++ stable/8/sys/dev/mxge/if_mxge.c Tue Apr 27 15:38:58 2010 (r207279) @@ -883,6 +883,9 @@ mxge_send_cmd(mxge_softc_t *sc, uint32_t case MXGEFW_CMD_ERROR_BUSY: err = EBUSY; break; + case MXGEFW_CMD_ERROR_I2C_ABSENT: + err = ENXIO; + break; default: device_printf(sc->dev, "mxge: command %d " @@ -2782,37 +2785,25 @@ static struct mxge_media_type mxge_sfp_m }; static void -mxge_set_media(mxge_softc_t *sc, int type) +mxge_media_set(mxge_softc_t *sc, int media_type) { - sc->media_flags |= type; - ifmedia_add(&sc->media, sc->media_flags, 0, NULL); - ifmedia_set(&sc->media, sc->media_flags); -} + + ifmedia_add(&sc->media, IFM_ETHER | IFM_FDX | media_type, + 0, NULL); + ifmedia_set(&sc->media, IFM_ETHER | IFM_FDX | media_type); + sc->current_media = media_type; + sc->media.ifm_media = sc->media.ifm_cur->ifm_media; +} -/* - * Determine the media type for a NIC. Some XFPs will identify - * themselves only when their link is up, so this is initiated via a - * link up interrupt. However, this can potentially take up to - * several milliseconds, so it is run via the watchdog routine, rather - * than in the interrupt handler itself. This need only be done - * once, not each time the link is up. - */ static void -mxge_media_probe(mxge_softc_t *sc) +mxge_media_init(mxge_softc_t *sc) { - mxge_cmd_t cmd; - char *cage_type; char *ptr; - struct mxge_media_type *mxge_media_types = NULL; - int i, err, ms, mxge_media_type_entries; - uint32_t byte; - - sc->need_media_probe = 0; + int i; - /* if we've already set a media type, we're done */ - if (sc->media_flags != (IFM_ETHER | IFM_AUTO)) - return; + ifmedia_removeall(&sc->media); + mxge_media_set(sc, IFM_AUTO); /* * parse the product code to deterimine the interface type @@ -2823,6 +2814,7 @@ mxge_media_probe(mxge_softc_t *sc) ptr = sc->product_code_string; if (ptr == NULL) { device_printf(sc->dev, "Missing product code\n"); + return; } for (i = 0; i < 3; i++, ptr++) { @@ -2835,17 +2827,44 @@ mxge_media_probe(mxge_softc_t *sc) } if (*ptr == 'C') { /* -C is CX4 */ - mxge_set_media(sc, IFM_10G_CX4); - return; - } - else if (*ptr == 'Q') { + sc->connector = MXGE_CX4; + mxge_media_set(sc, IFM_10G_CX4); + } else if (*ptr == 'Q') { /* -Q is Quad Ribbon Fiber */ + sc->connector = MXGE_QRF; device_printf(sc->dev, "Quad Ribbon Fiber Media\n"); /* FreeBSD has no media type for Quad ribbon fiber */ - return; + } else if (*ptr == 'R') { + /* -R is XFP */ + sc->connector = MXGE_XFP; + } else if (*ptr == 'S' || *(ptr +1) == 'S') { + /* -S or -2S is SFP+ */ + sc->connector = MXGE_SFP; + } else { + device_printf(sc->dev, "Unknown media type: %c\n", *ptr); } +} - if (*ptr == 'R') { +/* + * Determine the media type for a NIC. Some XFPs will identify + * themselves only when their link is up, so this is initiated via a + * link up interrupt. However, this can potentially take up to + * several milliseconds, so it is run via the watchdog routine, rather + * than in the interrupt handler itself. + */ +static void +mxge_media_probe(mxge_softc_t *sc) +{ + mxge_cmd_t cmd; + char *cage_type; + + struct mxge_media_type *mxge_media_types = NULL; + int i, err, ms, mxge_media_type_entries; + uint32_t byte; + + sc->need_media_probe = 0; + + if (sc->connector == MXGE_XFP) { /* -R is XFP */ mxge_media_types = mxge_xfp_media_types; mxge_media_type_entries = @@ -2853,9 +2872,7 @@ mxge_media_probe(mxge_softc_t *sc) sizeof (mxge_xfp_media_types[0]); byte = MXGE_XFP_COMPLIANCE_BYTE; cage_type = "XFP"; - } - - if (*ptr == 'S' || *(ptr +1) == 'S') { + } else if (sc->connector == MXGE_SFP) { /* -S or -2S is SFP+ */ mxge_media_types = mxge_sfp_media_types; mxge_media_type_entries = @@ -2863,10 +2880,8 @@ mxge_media_probe(mxge_softc_t *sc) sizeof (mxge_sfp_media_types[0]); cage_type = "SFP+"; byte = 3; - } - - if (mxge_media_types == NULL) { - device_printf(sc->dev, "Unknown media type: %c\n", *ptr); + } else { + /* nothing to do; media type cannot change */ return; } @@ -2909,7 +2924,10 @@ mxge_media_probe(mxge_softc_t *sc) if (mxge_verbose) device_printf(sc->dev, "%s:%s\n", cage_type, mxge_media_types[0].name); - mxge_set_media(sc, mxge_media_types[0].flag); + if (sc->current_media != mxge_media_types[0].flag) { + mxge_media_init(sc); + mxge_media_set(sc, mxge_media_types[0].flag); + } return; } for (i = 1; i < mxge_media_type_entries; i++) { @@ -2919,12 +2937,16 @@ mxge_media_probe(mxge_softc_t *sc) cage_type, mxge_media_types[i].name); - mxge_set_media(sc, mxge_media_types[i].flag); + if (sc->current_media != mxge_media_types[i].flag) { + mxge_media_init(sc); + mxge_media_set(sc, mxge_media_types[i].flag); + } return; } } - device_printf(sc->dev, "%s media 0x%x unknown\n", cage_type, - cmd.data0); + if (mxge_verbose) + device_printf(sc->dev, "%s media 0x%x unknown\n", + cage_type, cmd.data0); return; } @@ -2988,10 +3010,12 @@ mxge_intr(void *arg) sc->link_state = stats->link_up; if (sc->link_state) { if_link_state_change(sc->ifp, LINK_STATE_UP); + sc->ifp->if_baudrate = IF_Gbps(10UL); if (mxge_verbose) device_printf(sc->dev, "link up\n"); } else { if_link_state_change(sc->ifp, LINK_STATE_DOWN); + sc->ifp->if_baudrate = 0; if (mxge_verbose) device_printf(sc->dev, "link down\n"); } @@ -4026,9 +4050,9 @@ mxge_media_status(struct ifnet *ifp, str if (sc == NULL) return; ifmr->ifm_status = IFM_AVALID; + ifmr->ifm_active = IFM_ETHER | IFM_FDX; ifmr->ifm_status |= sc->link_state ? IFM_ACTIVE : 0; - ifmr->ifm_active = IFM_AUTO | IFM_ETHER; - ifmr->ifm_active |= sc->link_state ? IFM_FDX : 0; + ifmr->ifm_active |= sc->current_media; } static int @@ -4135,6 +4159,9 @@ mxge_ioctl(struct ifnet *ifp, u_long com break; case SIOCGIFMEDIA: + mtx_lock(&sc->driver_mtx); + mxge_media_probe(sc); + mtx_unlock(&sc->driver_mtx); err = ifmedia_ioctl(ifp, (struct ifreq *)data, &sc->media, command); break; @@ -4767,7 +4794,7 @@ mxge_attach(device_t dev) /* Initialise the ifmedia structure */ ifmedia_init(&sc->media, 0, mxge_media_change, mxge_media_status); - mxge_set_media(sc, IFM_ETHER | IFM_AUTO); + mxge_media_init(sc); mxge_media_probe(sc); sc->dying = 0; ether_ifattach(ifp, sc->mac_addr); Modified: stable/8/sys/dev/mxge/if_mxge_var.h ============================================================================== --- stable/8/sys/dev/mxge/if_mxge_var.h Tue Apr 27 15:16:54 2010 (r207278) +++ stable/8/sys/dev/mxge/if_mxge_var.h Tue Apr 27 15:38:58 2010 (r207279) @@ -268,6 +268,8 @@ struct mxge_softc { int num_slices; int rx_ring_size; int dying; + int connector; + int current_media; mxge_dma_t dmabench_dma; struct callout co_hdl; struct taskqueue *tq; @@ -293,6 +295,12 @@ struct mxge_softc { #define MXGE_MIN_THROTTLE 416 #define MXGE_MAX_THROTTLE 4096 +/* Types of connectors on NICs supported by this driver */ +#define MXGE_CX4 0 +#define MXGE_XFP 1 +#define MXGE_SFP 2 +#define MXGE_QRF 3 + #define MXGE_HIGHPART_TO_U32(X) \ (sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0) #define MXGE_LOWPART_TO_U32(X) ((uint32_t)(X)) From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 15:40:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF2691065672; Tue, 27 Apr 2010 15:40: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 9B06E8FC1E; Tue, 27 Apr 2010 15:40: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 o3RFeOei050283; Tue, 27 Apr 2010 15:40:24 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RFeOML050280; Tue, 27 Apr 2010 15:40:24 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201004271540.o3RFeOML050280@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 27 Apr 2010 15:40: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: r207280 - stable/7/sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Apr 2010 15:40:24 -0000 Author: gallatin Date: Tue Apr 27 15:40:24 2010 New Revision: 207280 URL: http://svn.freebsd.org/changeset/base/207280 Log: MFC 206662: Cleanup if_media handling in mxge(4) Modified: stable/7/sys/dev/mxge/if_mxge.c stable/7/sys/dev/mxge/if_mxge_var.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/7/sys/dev/mxge/if_mxge.c Tue Apr 27 15:38:58 2010 (r207279) +++ stable/7/sys/dev/mxge/if_mxge.c Tue Apr 27 15:40:24 2010 (r207280) @@ -876,6 +876,9 @@ mxge_send_cmd(mxge_softc_t *sc, uint32_t case MXGEFW_CMD_ERROR_BUSY: err = EBUSY; break; + case MXGEFW_CMD_ERROR_I2C_ABSENT: + err = ENXIO; + break; default: device_printf(sc->dev, "mxge: command %d " @@ -2596,37 +2599,25 @@ static struct mxge_media_type mxge_sfp_m }; static void -mxge_set_media(mxge_softc_t *sc, int type) +mxge_media_set(mxge_softc_t *sc, int media_type) { - sc->media_flags |= type; - ifmedia_add(&sc->media, sc->media_flags, 0, NULL); - ifmedia_set(&sc->media, sc->media_flags); -} + + ifmedia_add(&sc->media, IFM_ETHER | IFM_FDX | media_type, + 0, NULL); + ifmedia_set(&sc->media, IFM_ETHER | IFM_FDX | media_type); + sc->current_media = media_type; + sc->media.ifm_media = sc->media.ifm_cur->ifm_media; +} -/* - * Determine the media type for a NIC. Some XFPs will identify - * themselves only when their link is up, so this is initiated via a - * link up interrupt. However, this can potentially take up to - * several milliseconds, so it is run via the watchdog routine, rather - * than in the interrupt handler itself. This need only be done - * once, not each time the link is up. - */ static void -mxge_media_probe(mxge_softc_t *sc) +mxge_media_init(mxge_softc_t *sc) { - mxge_cmd_t cmd; - char *cage_type; char *ptr; - struct mxge_media_type *mxge_media_types = NULL; - int i, err, ms, mxge_media_type_entries; - uint32_t byte; - - sc->need_media_probe = 0; + int i; - /* if we've already set a media type, we're done */ - if (sc->media_flags != (IFM_ETHER | IFM_AUTO)) - return; + ifmedia_removeall(&sc->media); + mxge_media_set(sc, IFM_AUTO); /* * parse the product code to deterimine the interface type @@ -2637,6 +2628,7 @@ mxge_media_probe(mxge_softc_t *sc) ptr = sc->product_code_string; if (ptr == NULL) { device_printf(sc->dev, "Missing product code\n"); + return; } for (i = 0; i < 3; i++, ptr++) { @@ -2649,17 +2641,44 @@ mxge_media_probe(mxge_softc_t *sc) } if (*ptr == 'C') { /* -C is CX4 */ - mxge_set_media(sc, IFM_10G_CX4); - return; - } - else if (*ptr == 'Q') { + sc->connector = MXGE_CX4; + mxge_media_set(sc, IFM_10G_CX4); + } else if (*ptr == 'Q') { /* -Q is Quad Ribbon Fiber */ + sc->connector = MXGE_QRF; device_printf(sc->dev, "Quad Ribbon Fiber Media\n"); /* FreeBSD has no media type for Quad ribbon fiber */ - return; + } else if (*ptr == 'R') { + /* -R is XFP */ + sc->connector = MXGE_XFP; + } else if (*ptr == 'S' || *(ptr +1) == 'S') { + /* -S or -2S is SFP+ */ + sc->connector = MXGE_SFP; + } else { + device_printf(sc->dev, "Unknown media type: %c\n", *ptr); } +} - if (*ptr == 'R') { +/* + * Determine the media type for a NIC. Some XFPs will identify + * themselves only when their link is up, so this is initiated via a + * link up interrupt. However, this can potentially take up to + * several milliseconds, so it is run via the watchdog routine, rather + * than in the interrupt handler itself. + */ +static void +mxge_media_probe(mxge_softc_t *sc) +{ + mxge_cmd_t cmd; + char *cage_type; + + struct mxge_media_type *mxge_media_types = NULL; + int i, err, ms, mxge_media_type_entries; + uint32_t byte; + + sc->need_media_probe = 0; + + if (sc->connector == MXGE_XFP) { /* -R is XFP */ mxge_media_types = mxge_xfp_media_types; mxge_media_type_entries = @@ -2667,9 +2686,7 @@ mxge_media_probe(mxge_softc_t *sc) sizeof (mxge_xfp_media_types[0]); byte = MXGE_XFP_COMPLIANCE_BYTE; cage_type = "XFP"; - } - - if (*ptr == 'S' || *(ptr +1) == 'S') { + } else if (sc->connector == MXGE_SFP) { /* -S or -2S is SFP+ */ mxge_media_types = mxge_sfp_media_types; mxge_media_type_entries = @@ -2677,10 +2694,8 @@ mxge_media_probe(mxge_softc_t *sc) sizeof (mxge_sfp_media_types[0]); cage_type = "SFP+"; byte = 3; - } - - if (mxge_media_types == NULL) { - device_printf(sc->dev, "Unknown media type: %c\n", *ptr); + } else { + /* nothing to do; media type cannot change */ return; } @@ -2723,7 +2738,10 @@ mxge_media_probe(mxge_softc_t *sc) if (mxge_verbose) device_printf(sc->dev, "%s:%s\n", cage_type, mxge_media_types[0].name); - mxge_set_media(sc, mxge_media_types[0].flag); + if (sc->current_media != mxge_media_types[0].flag) { + mxge_media_init(sc); + mxge_media_set(sc, mxge_media_types[0].flag); + } return; } for (i = 1; i < mxge_media_type_entries; i++) { @@ -2733,12 +2751,16 @@ mxge_media_probe(mxge_softc_t *sc) cage_type, mxge_media_types[i].name); - mxge_set_media(sc, mxge_media_types[i].flag); + if (sc->current_media != mxge_media_types[i].flag) { + mxge_media_init(sc); + mxge_media_set(sc, mxge_media_types[i].flag); + } return; } } - device_printf(sc->dev, "%s media 0x%x unknown\n", cage_type, - cmd.data0); + if (mxge_verbose) + device_printf(sc->dev, "%s media 0x%x unknown\n", + cage_type, cmd.data0); return; } @@ -2798,10 +2820,12 @@ mxge_intr(void *arg) sc->link_state = stats->link_up; if (sc->link_state) { if_link_state_change(sc->ifp, LINK_STATE_UP); + sc->ifp->if_baudrate = IF_Gbps(10UL); if (mxge_verbose) device_printf(sc->dev, "link up\n"); } else { if_link_state_change(sc->ifp, LINK_STATE_DOWN); + sc->ifp->if_baudrate = 0; if (mxge_verbose) device_printf(sc->dev, "link down\n"); } @@ -3759,9 +3783,9 @@ mxge_media_status(struct ifnet *ifp, str if (sc == NULL) return; ifmr->ifm_status = IFM_AVALID; + ifmr->ifm_active = IFM_ETHER | IFM_FDX; ifmr->ifm_status |= sc->link_state ? IFM_ACTIVE : 0; - ifmr->ifm_active = IFM_AUTO | IFM_ETHER; - ifmr->ifm_active |= sc->link_state ? IFM_FDX : 0; + ifmr->ifm_active |= sc->current_media; } static int @@ -3868,6 +3892,9 @@ mxge_ioctl(struct ifnet *ifp, u_long com break; case SIOCGIFMEDIA: + mtx_lock(&sc->driver_mtx); + mxge_media_probe(sc); + mtx_unlock(&sc->driver_mtx); err = ifmedia_ioctl(ifp, (struct ifreq *)data, &sc->media, command); break; @@ -4484,7 +4511,7 @@ mxge_attach(device_t dev) /* Initialise the ifmedia structure */ ifmedia_init(&sc->media, 0, mxge_media_change, mxge_media_status); - mxge_set_media(sc, IFM_ETHER | IFM_AUTO); + mxge_media_init(sc); mxge_media_probe(sc); sc->dying = 0; ether_ifattach(ifp, sc->mac_addr); Modified: stable/7/sys/dev/mxge/if_mxge_var.h ============================================================================== --- stable/7/sys/dev/mxge/if_mxge_var.h Tue Apr 27 15:38:58 2010 (r207279) +++ stable/7/sys/dev/mxge/if_mxge_var.h Tue Apr 27 15:40:24 2010 (r207280) @@ -251,6 +251,8 @@ struct mxge_softc { int num_slices; int rx_ring_size; int dying; + int connector; + int current_media; mxge_dma_t dmabench_dma; struct callout co_hdl; struct taskqueue *tq; @@ -276,6 +278,12 @@ struct mxge_softc { #define MXGE_MIN_THROTTLE 416 #define MXGE_MAX_THROTTLE 4096 +/* Types of connectors on NICs supported by this driver */ +#define MXGE_CX4 0 +#define MXGE_XFP 1 +#define MXGE_SFP 2 +#define MXGE_QRF 3 + #define MXGE_HIGHPART_TO_U32(X) \ (sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0) #define MXGE_LOWPART_TO_U32(X) ((uint32_t)(X)) From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 15:50:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34D28106566B; Tue, 27 Apr 2010 15:50:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 227728FC15; Tue, 27 Apr 2010 15:50:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3RFoQG5052487; Tue, 27 Apr 2010 15:50:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RFoQxG052485; Tue, 27 Apr 2010 15:50:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004271550.o3RFoQxG052485@svn.freebsd.org> From: Marius Strobl Date: Tue, 27 Apr 2010 15:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207281 - head/sys/dev/esp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Apr 2010 15:50:26 -0000 Author: marius Date: Tue Apr 27 15:50:25 2010 New Revision: 207281 URL: http://svn.freebsd.org/changeset/base/207281 Log: Take advantage of OF_getscsinitid(). Modified: head/sys/dev/esp/esp_sbus.c Modified: head/sys/dev/esp/esp_sbus.c ============================================================================== --- head/sys/dev/esp/esp_sbus.c Tue Apr 27 15:40:24 2010 (r207280) +++ head/sys/dev/esp/esp_sbus.c Tue Apr 27 15:50:25 2010 (r207281) @@ -466,9 +466,7 @@ espattach(struct esp_softc *esc, const s goto fail_lock; } - if (OF_getprop(ofw_bus_get_node(esc->sc_dev), "scsi-initiator-id", - &sc->sc_id, sizeof(sc->sc_id)) == -1) - sc->sc_id = 7; + sc->sc_id = OF_getscsinitid(esc->sc_dev); #ifdef ESP_SBUS_DEBUG device_printf(esc->sc_dev, "%s: sc_id %d, freq %d\n", From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 15:59:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C53BB1065679; Tue, 27 Apr 2010 15:59:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B304C8FC1B; Tue, 27 Apr 2010 15:59: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 o3RFxcvw054557; Tue, 27 Apr 2010 15:59:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RFxckd054555; Tue, 27 Apr 2010 15:59:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201004271559.o3RFxckd054555@svn.freebsd.org> From: Alexander Motin Date: Tue, 27 Apr 2010 15:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207282 - 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: Tue, 27 Apr 2010 15:59:38 -0000 Author: mav Date: Tue Apr 27 15:59:38 2010 New Revision: 207282 URL: http://svn.freebsd.org/changeset/base/207282 Log: Update device identify data and serial number when device change detected. Reprobe immediately following this should have fresh data. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Tue Apr 27 15:50:25 2010 (r207281) +++ head/sys/cam/ata/ata_xpt.c Tue Apr 27 15:59:38 2010 (r207282) @@ -768,6 +768,7 @@ noerror: { struct ccb_pathinq cpi; int16_t *ptr; + int changed = 1; ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; @@ -809,9 +810,12 @@ noerror: sizeof(ident_buf->serial))) { /* Device changed. */ xpt_async(AC_LOST_DEVICE, path, NULL); - } else + } else { bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); - } else { + changed = 0; + } + } + if (changed) { bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); /* Clean up from previous instance of this device */ if (path->device->serial_num != NULL) { From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 17:50:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F7FF106564A; Tue, 27 Apr 2010 17:50:44 +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 3CB668FC15; Tue, 27 Apr 2010 17:50: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 o3RHoii1078885; Tue, 27 Apr 2010 17:50:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RHoi8G078883; Tue, 27 Apr 2010 17:50:44 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004271750.o3RHoi8G078883@svn.freebsd.org> From: Xin LI Date: Tue, 27 Apr 2010 17:50: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: r207283 - head/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 17:50:44 -0000 Author: delphij Date: Tue Apr 27 17:50:43 2010 New Revision: 207283 URL: http://svn.freebsd.org/changeset/base/207283 Log: Language improvements to make the BUGS section easier to read. Reviewed by: Alexander Best MFC after: 13 days Modified: head/usr.bin/gzip/gzip.1 Modified: head/usr.bin/gzip/gzip.1 ============================================================================== --- head/usr.bin/gzip/gzip.1 Tue Apr 27 15:59:38 2010 (r207282) +++ head/usr.bin/gzip/gzip.1 Tue Apr 27 17:50:43 2010 (r207283) @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 7, 2010 +.Dd April 27, 2010 .Dt GZIP 1 .Os .Sh NAME @@ -218,8 +218,8 @@ with unpack support written by .An Xin LI Aq delphij@FreeBSD.org . .Sh BUGS According to RFC 1952, the recorded file size is stored in a 32-bit -integer and therefore it can not represent files that is bigger than -4GB in size. This limitation also applies to +integer, therefore, it can not represent files larger than 4GB. +This limitation also applies to .Fl l option of .Nm From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 17:55:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6810B106566C; Tue, 27 Apr 2010 17:55:54 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id 736DF8FC14; Tue, 27 Apr 2010 17:55:53 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 22so338733eye.3 for ; Tue, 27 Apr 2010 10:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=GbK042Xq24LGMOMafC9HQb3o9xdzk72iY4QkEDUkMsU=; b=ORSWDCtOKSsH7MXMkesDFfosMqUHsdNh6haYi3uO4wtc3ycdq/Co/8ImTCniAMOuF0 MSQBV7Fo0mEwU78AuISFNN6QPEboHOKAOFUibxgeHiYpNCAkKTrV4HPeguiCxDlF1CA6 BtOEgP3vQhOL7HLr2iEgBJR80zIJSfggiCrN8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=xcZXolxt1ZrsG7MQVjHVySaMKdXeDE2ibGzxBs9rYSUcrpqru2N2vUTNNprBcqjnZI pTWcM9C+NY7XHE2cOanuLPbuLfTm5JiYVoQZr1PSjmTpopGJFu+JTbaWe3pATecDzkd7 1SeFptWhvYnQuqQD/TLgsvb9+/fXOHAHi4J6U= MIME-Version: 1.0 Received: by 10.213.74.13 with SMTP id s13mr2454441ebj.35.1272390945674; Tue, 27 Apr 2010 10:55:45 -0700 (PDT) Received: by 10.213.33.140 with HTTP; Tue, 27 Apr 2010 10:55:45 -0700 (PDT) In-Reply-To: <201004271750.o3RHoi8G078883@svn.freebsd.org> References: <201004271750.o3RHoi8G078883@svn.freebsd.org> Date: Tue, 27 Apr 2010 13:55:45 -0400 Message-ID: From: Ben Kaduk To: Xin LI Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207283 - head/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 17:55:54 -0000 On Tue, Apr 27, 2010 at 1:50 PM, Xin LI wrote: > Author: delphij > Date: Tue Apr 27 17:50:43 2010 > New Revision: 207283 > URL: http://svn.freebsd.org/changeset/base/207283 > > Log: > Language improvements to make the BUGS section easier to read. > > Reviewed by: Alexander Best > MFC after: 13 days > > Modified: > head/usr.bin/gzip/gzip.1 > > Modified: head/usr.bin/gzip/gzip.1 > ============================================================================== > --- head/usr.bin/gzip/gzip.1 Tue Apr 27 15:59:38 2010 (r207282) > +++ head/usr.bin/gzip/gzip.1 Tue Apr 27 17:50:43 2010 (r207283) > @@ -218,8 +218,8 @@ with unpack support written by > .An Xin LI Aq delphij@FreeBSD.org . > .Sh BUGS > According to RFC 1952, the recorded file size is stored in a 32-bit > -integer and therefore it can not represent files that is bigger than > -4GB in size. This limitation also applies to > +integer, therefore, it can not represent files larger than 4GB. > +This limitation also applies to Still not quite right -- the old version was wrong because it had "files that is" instead of "files that are". The new version has a comma splice, though -- the comma in "32-bit integer, therefore" should be replaced with either a semicolon or a full stop. I would probably also put in two "the"s in the text following this change -- "the -l option" and "the gzip utility". -Ben Kaduk > .Fl l > option of > .Nm > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 17:57:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20A271065672; Tue, 27 Apr 2010 17:57: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 0E3AC8FC1D; Tue, 27 Apr 2010 17:57:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3RHv4UW080299; Tue, 27 Apr 2010 17:57:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RHv4ZJ080297; Tue, 27 Apr 2010 17:57:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004271757.o3RHv4ZJ080297@svn.freebsd.org> From: Xin LI Date: Tue, 27 Apr 2010 17:57: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: r207284 - head/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 17:57:05 -0000 Author: delphij Date: Tue Apr 27 17:57:04 2010 New Revision: 207284 URL: http://svn.freebsd.org/changeset/base/207284 Log: Use _exit(2) system call directly instead of using exit(3) in signal handler, as the latter is not guaranteed to be signal safe, and we do not really care about flushing the stream during SIGINT. Suggested by: Maxim Konovalov MFC after: 13 days Modified: head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Tue Apr 27 17:50:43 2010 (r207283) +++ head/usr.bin/gzip/gzip.c Tue Apr 27 17:57:04 2010 (r207284) @@ -1178,7 +1178,7 @@ sigint_handler(int signo __unused) if (remove_file != NULL) unlink(remove_file); - exit(2); + _exit(2); } #endif From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 18:05:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06E30106564A; Tue, 27 Apr 2010 18:05:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C87E58FC08; Tue, 27 Apr 2010 18:05: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 o3RI5X54082219; Tue, 27 Apr 2010 18:05:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RI5XAp082217; Tue, 27 Apr 2010 18:05:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004271805.o3RI5XAp082217@svn.freebsd.org> From: Marius Strobl Date: Tue, 27 Apr 2010 18:05: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: r207285 - head/sys/dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Apr 2010 18:05:34 -0000 Author: marius Date: Tue Apr 27 18:05:33 2010 New Revision: 207285 URL: http://svn.freebsd.org/changeset/base/207285 Log: - On sparc64 obtain the initiator ID from the Open Firmware device tree in order to match what the PROM built-in driver uses. - Remove some no longer used includes. Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Tue Apr 27 17:57:04 2010 (r207284) +++ head/sys/dev/sym/sym_hipd.c Tue Apr 27 18:05:33 2010 (r207285) @@ -87,6 +87,12 @@ __FBSDID("$FreeBSD$"); #include #include + +#ifdef __sparc64__ +#include +#include +#endif + #include #include @@ -98,10 +104,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - /* Short and quite clear integer types */ typedef int8_t s8; typedef int16_t s16; @@ -2682,6 +2684,9 @@ static int sym_prepare_setting(hcb_p np, */ np->myaddr = 255; sym_nvram_setup_host (np, nvram); +#ifdef __sparc64__ + np->myaddr = OF_getscsinitid(np->device); +#endif /* * Get SCSI addr of host adapter (set by bios?). From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 18:06:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9761E106566C; Tue, 27 Apr 2010 18:06:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 854318FC18; Tue, 27 Apr 2010 18:06: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 o3RI6sIB082548; Tue, 27 Apr 2010 18:06:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RI6sUj082546; Tue, 27 Apr 2010 18:06:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004271806.o3RI6sUj082546@svn.freebsd.org> From: Marius Strobl Date: Tue, 27 Apr 2010 18:06: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: r207286 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 18:06:54 -0000 Author: marius Date: Tue Apr 27 18:06:54 2010 New Revision: 207286 URL: http://svn.freebsd.org/changeset/base/207286 Log: Replace a magic value with the appropriate macro. Modified: head/sys/dev/mpt/mpt_cam.c Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Tue Apr 27 18:05:33 2010 (r207285) +++ head/sys/dev/mpt/mpt_cam.c Tue Apr 27 18:06:54 2010 (r207286) @@ -1058,12 +1058,13 @@ mpt_read_config_info_spi(struct mpt_soft static int mpt_set_initial_config_spi(struct mpt_softc *mpt) { - int i, pp1val = ((1 << mpt->mpt_ini_id) << 16) | mpt->mpt_ini_id; - int error; + int error, i, pp1val; mpt->mpt_disc_enable = 0xff; mpt->mpt_tag_enable = 0; + pp1val = ((1 << mpt->mpt_ini_id) << + MPI_SCSIPORTPAGE1_CFG_SHIFT_PORT_RESPONSE_ID) | mpt->mpt_ini_id; if (mpt->mpt_port_page1.Configuration != pp1val) { CONFIG_PAGE_SCSI_PORT_1 tmp; From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 18:41:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83C881065670; Tue, 27 Apr 2010 18:41:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 722FF8FC4B; Tue, 27 Apr 2010 18:41: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 o3RIfGSn090117; Tue, 27 Apr 2010 18:41:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RIfG7f090113; Tue, 27 Apr 2010 18:41:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004271841.o3RIfG7f090113@svn.freebsd.org> From: Marius Strobl Date: Tue, 27 Apr 2010 18:41: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: r207287 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 18:41:16 -0000 Author: marius Date: Tue Apr 27 18:41:16 2010 New Revision: 207287 URL: http://svn.freebsd.org/changeset/base/207287 Log: On sparc64 obtain the initiator ID to be used for SPI HBAs from the Open Firmware device tree in order to match what the PROM built-in driver uses. This is especially important when netbooting Fujitsu Siemens PRIMEPOWER250 as in that case the built-in driver isn't used and the port facts PortSCSIID defaults to 0, conflicting with the disk at the same address. Modified: head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h head/sys/dev/mpt/mpt_pci.c Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Tue Apr 27 18:06:54 2010 (r207286) +++ head/sys/dev/mpt/mpt.c Tue Apr 27 18:41:16 2010 (r207287) @@ -2667,6 +2667,8 @@ mpt_configure_ioc(struct mpt_softc *mpt, mpt->is_fc = 0; mpt->is_sas = 0; mpt->is_spi = 1; + if (mpt->mpt_ini_id == MPT_INI_ID_NONE) + mpt->mpt_ini_id = pfp->PortSCSIID; } else if (pfp->PortType == MPI_PORTFACTS_PORTTYPE_ISCSI) { mpt_prt(mpt, "iSCSI not supported yet\n"); return (ENXIO); Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Tue Apr 27 18:06:54 2010 (r207286) +++ head/sys/dev/mpt/mpt.h Tue Apr 27 18:41:16 2010 (r207287) @@ -130,6 +130,11 @@ #include #endif +#ifdef __sparc64__ +#include +#include +#endif + #include #if __FreeBSD_version < 500000 @@ -172,6 +177,8 @@ #define MPT_ROLE_BOTH 3 #define MPT_ROLE_DEFAULT MPT_ROLE_INITIATOR +#define MPT_INI_ID_NONE -1 + /**************************** Forward Declarations ****************************/ struct mpt_softc; struct mpt_personality; @@ -637,7 +644,6 @@ struct mpt_softc { * Port Facts */ MSG_PORT_FACTS_REPLY * port_facts; -#define mpt_ini_id port_facts[0].PortSCSIID #define mpt_max_tgtcmds port_facts[0].MaxPostedCmdBuffers /* @@ -650,6 +656,7 @@ struct mpt_softc { CONFIG_PAGE_SCSI_PORT_2 _port_page2; CONFIG_PAGE_SCSI_DEVICE_0 _dev_page0[16]; CONFIG_PAGE_SCSI_DEVICE_1 _dev_page1[16]; + int _ini_id; uint16_t _tag_enable; uint16_t _disc_enable; } spi; @@ -658,6 +665,7 @@ struct mpt_softc { #define mpt_port_page2 cfg.spi._port_page2 #define mpt_dev_page0 cfg.spi._dev_page0 #define mpt_dev_page1 cfg.spi._dev_page1 +#define mpt_ini_id cfg.spi._ini_id #define mpt_tag_enable cfg.spi._tag_enable #define mpt_disc_enable cfg.spi._disc_enable struct mpi_fc_cfg { Modified: head/sys/dev/mpt/mpt_pci.c ============================================================================== --- head/sys/dev/mpt/mpt_pci.c Tue Apr 27 18:06:54 2010 (r207286) +++ head/sys/dev/mpt/mpt_pci.c Tue Apr 27 18:41:16 2010 (r207287) @@ -460,6 +460,11 @@ mpt_pci_attach(device_t dev) mpt->raid_queue_depth = MPT_RAID_QUEUE_DEPTH_DEFAULT; mpt->verbose = MPT_PRT_NONE; mpt->role = MPT_ROLE_NONE; + mpt->mpt_ini_id = MPT_INI_ID_NONE; +#ifdef __sparc64__ + if (mpt->is_spi) + mpt->mpt_ini_id = OF_getscsinitid(dev); +#endif mpt_set_options(mpt); if (mpt->verbose == MPT_PRT_NONE) { mpt->verbose = MPT_PRT_WARN; From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 20:18:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4284E1065672; Tue, 27 Apr 2010 20:18:55 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4228FC17; Tue, 27 Apr 2010 20:18: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 o3RKItCu011994; Tue, 27 Apr 2010 20:18:55 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RKItYL011955; Tue, 27 Apr 2010 20:18:55 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201004272018.o3RKItYL011955@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 27 Apr 2010 20:18: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: r207292 - in stable/8/share/man/man4: . man4.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: Tue, 27 Apr 2010 20:18:55 -0000 Author: gavin Date: Tue Apr 27 20:18:54 2010 New Revision: 207292 URL: http://svn.freebsd.org/changeset/base/207292 Log: Merge r203692 from head: Kernel modules for these drivers are installed on all platforms, so install the man pages on all platforms too. Added: stable/8/share/man/man4/alpm.4 - copied unchanged from r203692, head/share/man/man4/alpm.4 stable/8/share/man/man4/amdpm.4 - copied unchanged from r203692, head/share/man/man4/amdpm.4 stable/8/share/man/man4/mcd.4 - copied unchanged from r203692, head/share/man/man4/mcd.4 stable/8/share/man/man4/pcf.4 - copied unchanged from r203692, head/share/man/man4/pcf.4 stable/8/share/man/man4/scd.4 - copied unchanged from r203692, head/share/man/man4/scd.4 stable/8/share/man/man4/viapm.4 - copied unchanged from r203692, head/share/man/man4/viapm.4 Deleted: stable/8/share/man/man4/man4.i386/alpm.4 stable/8/share/man/man4/man4.i386/amdpm.4 stable/8/share/man/man4/man4.i386/mcd.4 stable/8/share/man/man4/man4.i386/pcf.4 stable/8/share/man/man4/man4.i386/scd.4 stable/8/share/man/man4/man4.i386/viapm.4 Modified: stable/8/share/man/man4/Makefile stable/8/share/man/man4/man4.i386/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Tue Apr 27 20:18:09 2010 (r207291) +++ stable/8/share/man/man4/Makefile Tue Apr 27 20:18:54 2010 (r207292) @@ -29,8 +29,10 @@ MAN= aac.4 \ aio.4 \ alc.4 \ ale.4 \ + alpm.4 \ altq.4 \ amd.4 \ + amdpm.4 \ ${_amdsmb.4} \ ${_amdtemp.4} \ amr.4 \ @@ -198,6 +200,7 @@ MAN= aac.4 \ mac_stub.4 \ mac_test.4 \ malo.4 \ + mcd.4 \ md.4 \ mem.4 \ meteor.4 \ @@ -301,6 +304,7 @@ MAN= aac.4 \ patm.4 \ pccard.4 \ pccbb.4 \ + pcf.4 \ pci.4 \ pcib.4 \ pcic.4 \ @@ -333,6 +337,7 @@ MAN= aac.4 \ sbp.4 \ sbp_targ.4 \ scc.4 \ + scd.4 \ sched_4bsd.4 \ sched_ule.4 \ screen.4 \ @@ -452,6 +457,7 @@ MAN= aac.4 \ uvscom.4 \ vga.4 \ vge.4 \ + viapm.4 \ vinum.4 \ vkbd.4 \ vlan.4 \ Copied: stable/8/share/man/man4/alpm.4 (from r203692, head/share/man/man4/alpm.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/alpm.4 Tue Apr 27 20:18:54 2010 (r207292, copy of r203692, head/share/man/man4/alpm.4) @@ -0,0 +1,62 @@ +.\" Copyright (c) 1999 Nicolas Souchu +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 13, 1999 +.Dt ALPM 4 +.Os +.Sh NAME +.Nm alpm +.Nd Acer Aladdin 15x3 Power Management controller driver +.Sh SYNOPSIS +.Cd device smbus +.Cd device smb +.Cd device alpm +.Sh DESCRIPTION +This driver provides access to the +.Tn Aladdin 15x3 Power Management Unit . +Currently, only smbus controller +function is implemented. +.Pp +The embedded SMBus controller of the Aladdin chipset may give you access +to the monitoring facilities of your mainboard. +See +.Xr smb 4 +for writing user code to fetch voltages, temperature and so on from the +monitoring chip of your mainboard. +.Sh SEE ALSO +.Xr smb 4 , +.Xr smbus 4 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 4.0 . +.Sh AUTHORS +This +manual page was written by +.An Nicolas Souchu Aq nsouch@FreeBSD.org +.Sh BUGS +Only polling mode is supported. Copied: stable/8/share/man/man4/amdpm.4 (from r203692, head/share/man/man4/amdpm.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/amdpm.4 Tue Apr 27 20:18:54 2010 (r207292, copy of r203692, head/share/man/man4/amdpm.4) @@ -0,0 +1,72 @@ +.\" Copyright (c) 2001 Murray Stokely +.\" Copyright (c) 1999 Takanori Watanabe +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 31, 2005 +.Dt AMDPM 4 +.Os +.Sh NAME +.Nm amdpm +.Nd AMD 756/766/768/8111 Power Management controller driver +.Sh SYNOPSIS +.Cd device smbus +.Cd device smb +.Cd device amdpm +.Sh DESCRIPTION +This driver provides access to +.Tn AMD 756/766/768/8111 Power management controllers . +Currently, only the SMBus 1.0 controller function is implemented. +The SMBus 2.0 functionality of the AMD 8111 controller is supported via the +.Xr amdsmb 4 +driver. +.Pp +The embedded SMBus controller of the AMD 756 chipset may give you access +to the monitoring facilities of your mainboard. +See +.Xr smb 4 +for writing user code to fetch voltages, temperature and so on from the +monitoring chip of your mainboard. +.Sh SEE ALSO +.Xr amdsmb 4 , +.Xr smb 4 , +.Xr smbus 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 4.5 . +.Sh AUTHORS +.An -nosplit +This driver was written by +.An "Matthew C. Forman" . +Based heavily on the +.Nm alpm +driver by +.An Nicolas Souchu . +This manual page was written by +.An Murray Stokely Aq murray@FreeBSD.org . +.Sh BUGS +Only polling mode is supported. Modified: stable/8/share/man/man4/man4.i386/Makefile ============================================================================== --- stable/8/share/man/man4/man4.i386/Makefile Tue Apr 27 20:18:09 2010 (r207291) +++ stable/8/share/man/man4/man4.i386/Makefile Tue Apr 27 20:18:54 2010 (r207292) @@ -1,8 +1,6 @@ # $FreeBSD$ MAN= aic.4 \ - alpm.4 \ - amdpm.4 \ apm.4 \ ce.4 \ cp.4 \ @@ -17,22 +15,18 @@ MAN= aic.4 \ glxsb.4 \ ie.4 \ longrun.4 \ - mcd.4 \ mse.4 \ npx.4 \ pae.4 \ pbio.4 \ - pcf.4 \ perfmon.4 \ pnp.4 \ pnpbios.4 \ sbni.4 \ - scd.4 \ smapi.4 \ snc.4 \ streams.4 \ svr4.4 \ - viapm.4 \ vpd.4 \ vx.4 \ wl.4 Copied: stable/8/share/man/man4/mcd.4 (from r203692, head/share/man/man4/mcd.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/mcd.4 Tue Apr 27 20:18:54 2010 (r207292, copy of r203692, head/share/man/man4/mcd.4) @@ -0,0 +1,169 @@ +.\" +.\" Copyright (c) 1994 Keith E. Walker +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 8, 1994 +.Dt MCD 4 +.Os +.Sh NAME +.Nm mcd +.Nd Mitsumi CD-ROM driver +.Sh SYNOPSIS +.Cd "device mcd" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.mcd.0.at="isa" +.Cd hint.mcd.0.port="0x300" +.Cd hint.mcd.0.irq="10" +.Sh DESCRIPTION +The +.Nm +driver provides a data and audio interface to the Mitsumi-brand CD-ROM +player. +The CD-ROM player must be interfaced to the ISA bus through +one of the Mitsumi proprietary controller boards. +The controller +boards supported are the LU002S, LU005S, the FX001 and the quite +common FX001D. +.Pp +The +.Nm +driver responds to disk-specific +.Fn ioctl +commands, namely the +.Dv DIOCGDINFO , +.Dv DIOCGPART , +.Dv DIOCWDINFO , +and +.Dv DIOCSDINFO , +commands. +Other disk-specific +.Fn ioctl +commands will return an error. +.Pp +The +.Nm +driver also responds to special CD-ROM +.Fn ioctl +commands. +These commands +control the CD-ROM player's audio features. +The commands are: +.Pp +.Bl -tag -width CDIOCREADSUBCHANNEL -compact -offset indent +.It CDIOCREADSUBCHANNEL +get sub-channel information on current status of disc playing +.It CDIOCREADTOCHEADER +get table of contents header +.It CDIOCREADTOCENTRYS +gets all of the table of contents +.It CDIOCPLAYTRACKS +begins audio playing at location specified +.It CDIOCPLAYBLOCKS +fails with error +.Er EINVAL +.It CDIOCPLAYMSF +begins audio playing at location specified +.It CDIOCRESUME +resumes playing a previously paused disc +.It CDIOCPAUSE +pauses a playing disc +.It CDIOCSTART +begins playing a disc +.It CDIOCSTOP +stops a previously playing disc +.It CDIOCEJECT +opens the disc tray (there is no support for a corresponding un-eject +command). +.It CDIOCRESET +stops any play and resets the Mitsumi controller board +.It CDIOCSETDEBUG +cause the kernel to print debug messages to the console about the +.Nm +driver +.It CDIOCCLRDEBUG +cause the kernel to quit printing debug messages about the +.Nm +driver +.El +.Pp +The +.Fn ioctl +commands defined above are the only ones that the +.Nm +driver supports. +There are other CD-ROM related +.Fn ioctl +commands (such as +.Dv CDIOCSETVOL +and +.Dv CDIOCSETSTERIO ) +which are available +and may be supported by future versions of the driver. +.Sh FILES +.Bl -tag -width /dev/(r)mcd0a -compact +.It Pa /dev/(r)mcd0a +accesses +.Bx +partition on the disc. +Normally, there is only +one file system on a CD-ROM disc. +.It Pa /dev/(r)mcd0c +accesses raw device. +.El +.Sh NOTES +The character-mode devices for the +.Nm +driver should only be used for accessing the audio features of the +CD-ROM player as the performance on data is abysmal. +.Pp +The current version of the driver uses neither the DMA or IRQ +features of the interface board, although it has an interrupt handler +for any IRQ requests that are generated. +Until the DMA features are +supported, the only interrupts that the board generates are those that +are not supported by the driver anyway. +.Sh SEE ALSO +.In sys/cdio.h +.Sh HISTORY +An +.Nm +driver appeared in +.Fx 1.0 . +.Sh AUTHORS +.An -nosplit +The driver was written by +.An Holger Veit +(data part) and +.An Brian Moore +(audio part). +Changes were provided by +.An Gary Clark II , +.An Andrew A. Chernov , +and +.An Jordan K. Hubbard . Copied: stable/8/share/man/man4/pcf.4 (from r203692, head/share/man/man4/pcf.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/pcf.4 Tue Apr 27 20:18:54 2010 (r207292, copy of r203692, head/share/man/man4/pcf.4) @@ -0,0 +1,72 @@ +.\" Copyright (c) 1998, Nicolas Souchu +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 6, 1998 +.Dt PCF 4 +.Os +.Sh NAME +.Nm pcf +.Nd Philips I2C bus controller +.Sh SYNOPSIS +.Cd "device pcf" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.pcf.0.at="isa" +.Cd hint.pcf.0.port="0x320" +.Cd hint.pcf.0.irq="5" +.Pp +For one or more iicbus busses: +.Cd "device iicbus" +.Sh DESCRIPTION +The +.Em pcf +driver provides support to the Philips PCF8584 I2C controller for the +.Xr iicbus 4 +system. +.Pp +The PCF8584 is an integrated circuit designed in CMOS technology which serves +as an interface between most standard parallel-bus +microcontrollers/microprocessors and the serial I2C-bus. +The PCF8584 +provides both master and slave functions. +Communication with I2C-bus is +carried out on a byte-wise basis using interrupt or polled handshake. +It +controls all the I2C-bus specific sequences, protocol, arbitration and timing. +The PCF8584 allows parallel-bus systems to communicate bidirectionally with +the I2C-bus. +.Sh SEE ALSO +.Xr iicbus 4 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 3.0 . +.Sh AUTHORS +This +manual page was written by +.An Nicolas Souchu . Copied: stable/8/share/man/man4/scd.4 (from r203692, head/share/man/man4/scd.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/scd.4 Tue Apr 27 20:18:54 2010 (r207292, copy of r203692, head/share/man/man4/scd.4) @@ -0,0 +1,74 @@ +.\" +.\" Copyright (c) 1995 Jordan K. Hubbard +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 17, 2008 +.Dt SCD 4 +.Os +.Sh NAME +.Nm scd +.Nd Sony CDU31/33 CD-ROM driver +.Sh SYNOPSIS +.Cd "device scd" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.scd.0.at="isa" +.Cd hint.scd.0.port="0x230" +.Sh DESCRIPTION +The +.Nm +driver provides a data interface to the Sony CDU31 and CDU33A CD-ROM +drives. +The drive must be hooked to a Sony proprietary interface +card or a compatible clone. +.Sh FILES +.Bl -tag -width /dev/[r]scd0a -compact +.It Pa /dev/[r]scd0a +accesses +.Bx +partition on the disc. +Normally, there is only +one file system on a CDROM disc. +.It Pa /dev/[r]scd0c +accesses the raw device. +.El +.Sh SEE ALSO +.Pa /sys/dev/scd/scd.c +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 2.0.5 . +.Sh AUTHORS +.An -nosplit +The driver was written by +.An Mikael Hybsch +with code contributed by +.An Holger Veit +and +.An Brian Moore . Copied: stable/8/share/man/man4/viapm.4 (from r203692, head/share/man/man4/viapm.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/viapm.4 Tue Apr 27 20:18:54 2010 (r207292, copy of r203692, head/share/man/man4/viapm.4) @@ -0,0 +1,72 @@ +.\" Copyright (c) 2002 Nicolas Souchu +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 20, 2002 +.Dt VIAPM 4 +.Os +.Sh NAME +.Nm viapm +.Nd VIA chipsets Power Management controller driver +.Sh SYNOPSIS +.Cd device iicbb +.Cd device iicbus +.Cd device iicsmb +.Cd device smbus +.Cd device smb +.Cd device viapm +.Sh DESCRIPTION +This driver provides access to the +.Tn "VIA chipset Power Management Unit" +family. +They are +VT82C586B, VT82C596A, VT82C596B, VT82C686A and VT8233. +.Pp +The embedded controller of the VIA chipset may give you access +to the monitoring facilities of your mainboard. +.Pp +The 586B support is made by software whereas other controllers support +the SMBus protocol by hardware. +See +.Xr smb 4 +for writing user code to fetch voltages, temperature and so on from the +monitoring chip of your mainboard. +.Sh SEE ALSO +.Xr iicbb 4 , +.Xr iicbus 4 , +.Xr iicsmb 4 , +.Xr smb 4 , +.Xr smbus 4 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 4.5 . +.Sh AUTHORS +This +manual page was written by +.An Nicolas Souchu Aq nsouch@FreeBSD.org . +.Sh BUGS +Only polling mode is supported. From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 20:40:50 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 110071065672; Tue, 27 Apr 2010 20:40:50 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id CCCD48FC13; Tue, 27 Apr 2010 20:40:49 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id A41B535A828; Tue, 27 Apr 2010 22:33:52 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 995D017531; Tue, 27 Apr 2010 22:33:52 +0200 (CEST) Date: Tue, 27 Apr 2010 22:33:52 +0200 From: Jilles Tjoelker To: Andrey Chernov , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20100427203352.GB7165@stack.nl> References: <201004252043.o3PKhJi7065713@svn.freebsd.org> <20100427035224.GA87611@nagual.pp.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100427035224.GA87611@nagual.pp.ru> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: svn commit: r207206 - 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: Tue, 27 Apr 2010 20:40:50 -0000 On Tue, Apr 27, 2010 at 07:52:25AM +0400, Andrey Chernov wrote: > On Sun, Apr 25, 2010 at 08:43:19PM +0000, Jilles Tjoelker wrote: > > Author: jilles > > Date: Sun Apr 25 20:43:19 2010 > > New Revision: 207206 > > URL: http://svn.freebsd.org/changeset/base/207206 > > > > Log: > > sh: Use stalloc for arith variable names. > > > > This is simpler than the custom memory tracker I added earlier, and is also > > needed by the dash arith code I plan to import. > Just wonder, do you have plans to implement ${!variable} sometimes? > This bashism is very useful: > VAR_a1=foo > x=VAR_a1 > echo ${!x} This doesn't do anything you cannot do with eval: eval echo \$$x Furthermore, note that ksh93 and recent versions of mksh have almost the opposite meaning for ${!variable}, for example VAR_a1=foo typeset -n x=VAR_a1 echo $x:${!x} which prints foo:VAR_a1 (Explanation: typeset -n creates a "nameref" which redirects assignment and expansion to the variable name specified in the initial assignment. ${!X} expands to the name of the variable which is X unless X is a nameref.) We do have the setvar builtin for the reverse operation, inherited from the original ash, but I wouldn't have added this as it is likewise easily done with eval. The list assignment syntax setvar var word1 ... wordN has never been implemented, and I don't think it adds anything above ksh's syntaxes var=(word1 ... wordN) and set -A var word1 ... wordN -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 20:51:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B16F106564A; Tue, 27 Apr 2010 20:51:50 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4D18FC14; Tue, 27 Apr 2010 20:51: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 o3RKpoCw019276; Tue, 27 Apr 2010 20:51:50 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RKpoh9019274; Tue, 27 Apr 2010 20:51:50 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201004272051.o3RKpoh9019274@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 27 Apr 2010 20:51:50 +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: r207294 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Apr 2010 20:51:50 -0000 Author: gavin Date: Tue Apr 27 20:51:50 2010 New Revision: 207294 URL: http://svn.freebsd.org/changeset/base/207294 Log: Merge r204418 from head (original commit by antoine) Add files moved in r203976 and r207292 to ObsoleteFiles.inc Requested by: Alex Kozlov Merge OK'd by: antoine Modified: stable/8/ObsoleteFiles.inc (contents, props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Tue Apr 27 20:50:32 2010 (r207293) +++ stable/8/ObsoleteFiles.inc Tue Apr 27 20:51:50 2010 (r207294) @@ -34,6 +34,16 @@ OLD_FILES+=usr/share/man/man1/gcpio.1.gz # 20100301: vesa and dpms promoted to be i386/amd64 common OLD_FILES+=usr/include/machine/pc/vesa.h OLD_FILES+=usr/share/man/man4/i386/dpms.4.gz +# 20100208: man pages moved +.if ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/share/man/man4/i386/alpm.4.gz +OLD_FILES+=usr/share/man/man4/i386/amdpm.4.gz +OLD_FILES+=usr/share/man/man4/i386/mcd.4.gz +OLD_FILES+=usr/share/man/man4/i386/padlock.4.gz +OLD_FILES+=usr/share/man/man4/i386/pcf.4.gz +OLD_FILES+=usr/share/man/man4/i386/scd.4.gz +OLD_FILES+=usr/share/man/man4/i386/viapm.4.gz +.endif # 20091229: remove no longer relevant examples OLD_FILES+=usr/share/examples/pppd/auth-down.sample OLD_FILES+=usr/share/examples/pppd/auth-up.sample From owner-svn-src-all@FreeBSD.ORG Tue Apr 27 23:48:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A2A61065672; Tue, 27 Apr 2010 23:48:51 +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 5BC818FC0A; Tue, 27 Apr 2010 23:48: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 o3RNmppo058436; Tue, 27 Apr 2010 23:48:51 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3RNmpeX058434; Tue, 27 Apr 2010 23:48:51 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004272348.o3RNmpeX058434@svn.freebsd.org> From: Kip Macy Date: Tue, 27 Apr 2010 23:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207303 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 23:48:51 -0000 Author: kmacy Date: Tue Apr 27 23:48:50 2010 New Revision: 207303 URL: http://svn.freebsd.org/changeset/base/207303 Log: need to initialize the lock before it is used MFC after: 3 days Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Tue Apr 27 23:22:12 2010 (r207302) +++ head/sys/net/flowtable.c Tue Apr 27 23:48:50 2010 (r207303) @@ -1626,7 +1626,7 @@ flowtable_init(const void *unused __unus EVENTHANDLER_PRI_ANY); flowclean_freq = 20*hz; } -SYSINIT(flowtable_init, SI_SUB_SMP, SI_ORDER_MIDDLE, +SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, flowtable_init, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 00:49:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98C1A1065670; Wed, 28 Apr 2010 00:49:25 +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 885E28FC18; Wed, 28 Apr 2010 00:49: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 o3S0nP6d071875; Wed, 28 Apr 2010 00:49:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3S0nP3l071870; Wed, 28 Apr 2010 00:49:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004280049.o3S0nP3l071870@svn.freebsd.org> From: Xin LI Date: Wed, 28 Apr 2010 00:49: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: r207304 - in stable/8: sbin/ifconfig share/man/man4 sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 00:49:25 -0000 Author: delphij Date: Wed Apr 28 00:49:24 2010 New Revision: 207304 URL: http://svn.freebsd.org/changeset/base/207304 Log: MFC r206637: When an underlying ioctl(2) handler returns an error, our ioctl(2) interface considers that it hits a fatal error, and will not copyout the request structure back for _IOW and _IOWR ioctls, keeping them untouched. The previous implementation of the SIOCGIFDESCR ioctl intends to feed the buffer length back to userland. However, if we return an error, the feedback would be defeated and ifconfig(8) would trap into an infinite loop. This commit changes SIOCGIFDESCR to set buffer field to NULL to indicate the previous ENAMETOOLONG case. Reported by: bschmidt Modified: stable/8/sbin/ifconfig/ifconfig.c stable/8/share/man/man4/netintro.4 stable/8/sys/net/if.c Directory Properties: stable/8/sbin/ifconfig/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.c Tue Apr 27 23:48:50 2010 (r207303) +++ stable/8/sbin/ifconfig/ifconfig.c Wed Apr 28 00:49:24 2010 (r207304) @@ -906,19 +906,20 @@ status(const struct afswtch *afp, const ifr.ifr_buffer.buffer = descr; ifr.ifr_buffer.length = descrlen; if (ioctl(s, SIOCGIFDESCR, &ifr) == 0) { - if (strlen(descr) > 0) - printf("\tdescription: %s\n", descr); - break; - } else if (errno == ENAMETOOLONG) - descrlen = ifr.ifr_buffer.length; - else - break; - } else { + if (ifr.ifr_buffer.buffer == descr) { + if (strlen(descr) > 0) + printf("\tdescription: %s\n", + descr); + } else if (ifr.ifr_buffer.length > descrlen) { + descrlen = ifr.ifr_buffer.length; + continue; + } + } + } else warn("unable to allocate memory for interface" "description"); - break; - } - }; + break; + } if (ioctl(s, SIOCGIFCAP, (caddr_t)&ifr) == 0) { if (ifr.ifr_curcap != 0) { Modified: stable/8/share/man/man4/netintro.4 ============================================================================== --- stable/8/share/man/man4/netintro.4 Tue Apr 27 23:48:50 2010 (r207303) +++ stable/8/share/man/man4/netintro.4 Wed Apr 28 00:49:24 2010 (r207304) @@ -32,7 +32,7 @@ .\" @(#)netintro.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd April 14, 2010 .Dt NETINTRO 4 .Os .Sh NAME @@ -292,8 +292,11 @@ field of struct passed in as parameter, and the length would include the terminating nul character. If there is not enough space to hold the interface length, -no copy would be done and an -error would be returned. +no copy would be done and the +.Va buffer +field of +.Va ifru_buffer +would be set to NULL. The kernel will store the buffer length in the .Va length field upon return, regardless whether the buffer itself is Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Tue Apr 27 23:48:50 2010 (r207303) +++ stable/8/sys/net/if.c Wed Apr 28 00:49:24 2010 (r207304) @@ -2115,14 +2115,13 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, case SIOCGIFDESCR: error = 0; sx_slock(&ifdescr_sx); - if (ifp->if_description == NULL) { - ifr->ifr_buffer.length = 0; + if (ifp->if_description == NULL) error = ENOMSG; - } else { + else { /* space for terminating nul */ descrlen = strlen(ifp->if_description) + 1; if (ifr->ifr_buffer.length < descrlen) - error = ENAMETOOLONG; + ifr->ifr_buffer.buffer = NULL; else error = copyout(ifp->if_description, ifr->ifr_buffer.buffer, descrlen); From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 04:25:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76E9E1065670; Wed, 28 Apr 2010 04:25:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 634B58FC1F; Wed, 28 Apr 2010 04:25:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3S4PaSs019694; Wed, 28 Apr 2010 04:25:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3S4Pae5019693; Wed, 28 Apr 2010 04:25:36 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004280425.o3S4Pae5019693@svn.freebsd.org> From: Alan Cox Date: Wed, 28 Apr 2010 04:25: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: r207305 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 04:25:36 -0000 Author: alc Date: Wed Apr 28 04:25:36 2010 New Revision: 207305 URL: http://svn.freebsd.org/changeset/base/207305 Log: Adapt i386 r207205 to mips: Clearing PV_TABLE_REF and setting the page's PG_REFERENCED flag in pmap_protect() can't really be justified, so don't do it. Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Wed Apr 28 00:49:24 2010 (r207304) +++ head/sys/mips/mips/pmap.c Wed Apr 28 04:25:36 2010 (r207305) @@ -1690,16 +1690,10 @@ retry: obits = pbits = *pte; pa = mips_tlbpfn_to_paddr(pbits); - if (page_is_managed(pa)) { + if (page_is_managed(pa) && (pbits & PTE_M) != 0) { m = PHYS_TO_VM_PAGE(pa); - if (m->md.pv_flags & PV_TABLE_REF) { - vm_page_flag_set(m, PG_REFERENCED); - m->md.pv_flags &= ~PV_TABLE_REF; - } - if (pbits & PTE_M) { - vm_page_dirty(m); - m->md.pv_flags &= ~PV_TABLE_MOD; - } + vm_page_dirty(m); + m->md.pv_flags &= ~PV_TABLE_MOD; } pbits = (pbits & ~PTE_M) | PTE_RO; From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 04:57:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B59A9106564A; Wed, 28 Apr 2010 04:57:32 +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 A1E288FC13; Wed, 28 Apr 2010 04:57: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 o3S4vWAS026727; Wed, 28 Apr 2010 04:57:32 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3S4vWCH026725; Wed, 28 Apr 2010 04:57:32 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004280457.o3S4vWCH026725@svn.freebsd.org> From: Alan Cox Date: Wed, 28 Apr 2010 04:57: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: r207306 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 04:57:32 -0000 Author: alc Date: Wed Apr 28 04:57:32 2010 New Revision: 207306 URL: http://svn.freebsd.org/changeset/base/207306 Log: Change vm_object_madvise() so that it checks whether the page is invalid or unmanaged before acquiring the page queues lock. Neither of these tests require that lock. Moreover, a better way of testing if the page is unmanaged is to test the type of vm object. This avoids a pointless vm_page_lookup(). MFC after: 3 weeks Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Apr 28 04:25:36 2010 (r207305) +++ head/sys/vm/vm_object.c Wed Apr 28 04:57:32 2010 (r207306) @@ -1162,7 +1162,8 @@ shadowlookup: (tobject->flags & OBJ_ONEMAPPING) == 0) { goto unlock_tobject; } - } + } else if (tobject->type == OBJT_PHYS) + goto unlock_tobject; m = vm_page_lookup(tobject, tpindex); if (m == NULL && advise == MADV_WILLNEED) { /* @@ -1189,18 +1190,13 @@ shadowlookup: VM_OBJECT_UNLOCK(tobject); tobject = backing_object; goto shadowlookup; - } + } else if (m->valid != VM_PAGE_BITS_ALL) + goto unlock_tobject; /* - * If the page is busy or not in a normal active state, - * we skip it. If the page is not managed there are no - * page queues to mess with. Things can break if we mess - * with pages in any of the below states. + * If the page is not in a normal state, skip it. */ vm_page_lock_queues(); - if (m->hold_count || - m->wire_count || - (m->flags & PG_UNMANAGED) || - m->valid != VM_PAGE_BITS_ALL) { + if (m->hold_count != 0 || m->wire_count != 0) { vm_page_unlock_queues(); goto unlock_tobject; } From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 06:34:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4719D106566B; Wed, 28 Apr 2010 06:34:48 +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 3517E8FC14; Wed, 28 Apr 2010 06:34:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3S6YlmB048160; Wed, 28 Apr 2010 06:34:47 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3S6YlpJ048158; Wed, 28 Apr 2010 06:34:47 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004280634.o3S6YlpJ048158@svn.freebsd.org> From: Alan Cox Date: Wed, 28 Apr 2010 06:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207308 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 06:34:48 -0000 Author: alc Date: Wed Apr 28 06:34:47 2010 New Revision: 207308 URL: http://svn.freebsd.org/changeset/base/207308 Log: Setting PG_REFERENCED on a page at the end of vm_fault() is redundant since the page table entry's accessed bit is either preset by the immediately preceding call to pmap_enter() or by hardware (or software) upon return from vm_fault() when the faulting access is restarted. Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Apr 28 05:33:59 2010 (r207307) +++ head/sys/vm/vm_fault.c Wed Apr 28 06:34:47 2010 (r207308) @@ -924,7 +924,6 @@ vnode_locked: vm_fault_prefault(fs.map->pmap, vaddr, fs.entry); VM_OBJECT_LOCK(fs.object); vm_page_lock_queues(); - vm_page_flag_set(fs.m, PG_REFERENCED); /* * If the page is not wired down, then put it where the pageout daemon From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 07:26:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFA3B106564A; Wed, 28 Apr 2010 07:26:41 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3ADE8FC08; Wed, 28 Apr 2010 07:26: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 o3S7QfpC059623; Wed, 28 Apr 2010 07:26:41 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3S7QfDQ059621; Wed, 28 Apr 2010 07:26:41 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201004280726.o3S7QfDQ059621@svn.freebsd.org> From: Jeff Roberson Date: Wed, 28 Apr 2010 07:26: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: r207309 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 07:26:42 -0000 Author: jeff Date: Wed Apr 28 07:26:41 2010 New Revision: 207309 URL: http://svn.freebsd.org/changeset/base/207309 Log: - Fix builds without SOFTUPDATES defined in the kernel config. Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Apr 28 06:34:47 2010 (r207308) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Apr 28 07:26:41 2010 (r207309) @@ -123,6 +123,21 @@ softdep_uninitialize() } void +softdep_unmount(mp) + struct mount *mp; +{ + +} + +void +softdep_setup_sbupdate(ump, fs, bp) + struct ufsmount *ump; + struct fs *fs; + struct buf *bp; +{ +} + +void softdep_setup_inomapdep(bp, ip, newinum) struct buf *bp; struct inode *ip; @@ -267,6 +282,162 @@ softdep_setup_directory_change(bp, dp, i panic("softdep_setup_directory_change called"); } +void * +softdep_setup_trunc(vp, length, flags) + struct vnode *vp; + off_t length; + int flags; +{ + + panic("%s called", __FUNCTION__); + + return (NULL); +} + +int +softdep_complete_trunc(vp, cookie) + struct vnode *vp; + void *cookie; +{ + + panic("%s called", __FUNCTION__); + + return (0); +} + +void +softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) + struct mount *mp; + struct buf *bp; + ufs2_daddr_t blkno; + int frags; + struct workhead *wkhd; +{ + + panic("%s called", __FUNCTION__); +} + +void +softdep_setup_inofree(mp, bp, ino, wkhd) + struct mount *mp; + struct buf *bp; + ino_t ino; + struct workhead *wkhd; +{ + + panic("%s called", __FUNCTION__); +} + +void +softdep_setup_unlink(dp, ip) + struct inode *dp; + struct inode *ip; +{ + + panic("%s called", __FUNCTION__); +} + +void +softdep_setup_link(dp, ip) + struct inode *dp; + struct inode *ip; +{ + + panic("%s called", __FUNCTION__); +} + +void +softdep_revert_link(dp, ip) + struct inode *dp; + struct inode *ip; +{ + + panic("%s called", __FUNCTION__); +} + +void +softdep_setup_rmdir(dp, ip) + struct inode *dp; + struct inode *ip; +{ + + panic("%s called", __FUNCTION__); +} + +void +softdep_revert_rmdir(dp, ip) + struct inode *dp; + struct inode *ip; +{ + + panic("%s called", __FUNCTION__); +} + +void +softdep_setup_create(dp, ip) + struct inode *dp; + struct inode *ip; +{ + + panic("%s called", __FUNCTION__); +} + +void +softdep_revert_create(dp, ip) + struct inode *dp; + struct inode *ip; +{ + + panic("%s called", __FUNCTION__); +} + +void +softdep_setup_mkdir(dp, ip) + struct inode *dp; + struct inode *ip; +{ + + panic("%s called", __FUNCTION__); +} + +void +softdep_revert_mkdir(dp, ip) + struct inode *dp; + struct inode *ip; +{ + + panic("%s called", __FUNCTION__); +} + +void +softdep_setup_dotdot_link(dp, ip) + struct inode *dp; + struct inode *ip; +{ + + panic("%s called", __FUNCTION__); +} + +int +softdep_prealloc(vp, waitok) + struct vnode *vp; + int waitok; +{ + + panic("%s called", __FUNCTION__); + + return (0); +} + +int +softdep_journal_lookup(mp, vpp) + struct mount *mp; + struct vnode **vpp; +{ + + return (ENOENT); +} + void softdep_change_linkcnt(ip) struct inode *ip; From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 07:57:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 059381065674; Wed, 28 Apr 2010 07:57:37 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B31F68FC15; Wed, 28 Apr 2010 07:57: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 o3S7vbef066391; Wed, 28 Apr 2010 07:57:37 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3S7vbkc066389; Wed, 28 Apr 2010 07:57:37 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201004280757.o3S7vbkc066389@svn.freebsd.org> From: Jeff Roberson Date: Wed, 28 Apr 2010 07:57: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: r207310 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 07:57:38 -0000 Author: jeff Date: Wed Apr 28 07:57:37 2010 New Revision: 207310 URL: http://svn.freebsd.org/changeset/base/207310 Log: - When canceling jaddrefs they may not yet be in the journal if this is via a revert call. In this case don't attempt to remove something that has not yet been added. Otherwise this jaddref must hang around to prevent the bitmap write as normal. Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Apr 28 07:26:41 2010 (r207309) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Apr 28 07:57:37 2010 (r207310) @@ -3504,7 +3504,8 @@ cancel_jaddref(jaddref, inodedep, wkhd) WORKLIST_INSERT(wkhd, &jsegdep->jd_list); } else { free_jsegdep(jsegdep); - remove_from_journal(&jaddref->ja_list); + if (jaddref->ja_state & DEPCOMPLETE) + remove_from_journal(&jaddref->ja_list); } /* * Leave NEWBLOCK jaddrefs on the inodedep so handle_workitem_remove From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 08:37:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89FF01065673; Wed, 28 Apr 2010 08:37:01 +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 75E318FC0A; Wed, 28 Apr 2010 08:37: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 o3S8b1k9075070; Wed, 28 Apr 2010 08:37:01 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3S8b125075051; Wed, 28 Apr 2010 08:37:01 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201004280837.o3S8b125075051@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 28 Apr 2010 08:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207311 - in vendor-crypto/openssh/dist: . contrib contrib/caldera contrib/cygwin contrib/redhat contrib/suse openbsd-compat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 08:37:01 -0000 Author: des Date: Wed Apr 28 08:37:00 2010 New Revision: 207311 URL: http://svn.freebsd.org/changeset/base/207311 Log: Vendor import of OpenSSH 5.5p1 Modified: vendor-crypto/openssh/dist/ChangeLog vendor-crypto/openssh/dist/Makefile.in vendor-crypto/openssh/dist/README vendor-crypto/openssh/dist/auth-options.c vendor-crypto/openssh/dist/auth2-pubkey.c vendor-crypto/openssh/dist/channels.c vendor-crypto/openssh/dist/clientloop.c vendor-crypto/openssh/dist/config.h.in vendor-crypto/openssh/dist/configure vendor-crypto/openssh/dist/configure.ac vendor-crypto/openssh/dist/contrib/Makefile vendor-crypto/openssh/dist/contrib/caldera/openssh.spec vendor-crypto/openssh/dist/contrib/cygwin/Makefile vendor-crypto/openssh/dist/contrib/cygwin/ssh-host-config vendor-crypto/openssh/dist/contrib/redhat/openssh.spec vendor-crypto/openssh/dist/contrib/ssh-copy-id vendor-crypto/openssh/dist/contrib/suse/openssh.spec vendor-crypto/openssh/dist/defines.h vendor-crypto/openssh/dist/key.c vendor-crypto/openssh/dist/key.h vendor-crypto/openssh/dist/loginrec.c vendor-crypto/openssh/dist/logintest.c vendor-crypto/openssh/dist/moduli.0 vendor-crypto/openssh/dist/openbsd-compat/bsd-arc4random.c vendor-crypto/openssh/dist/scp.0 vendor-crypto/openssh/dist/servconf.c vendor-crypto/openssh/dist/session.c vendor-crypto/openssh/dist/sftp-server.0 vendor-crypto/openssh/dist/sftp.0 vendor-crypto/openssh/dist/ssh-add.0 vendor-crypto/openssh/dist/ssh-agent.0 vendor-crypto/openssh/dist/ssh-keygen.0 vendor-crypto/openssh/dist/ssh-keygen.1 vendor-crypto/openssh/dist/ssh-keygen.c vendor-crypto/openssh/dist/ssh-keyscan.0 vendor-crypto/openssh/dist/ssh-keysign.0 vendor-crypto/openssh/dist/ssh-pkcs11-helper.0 vendor-crypto/openssh/dist/ssh-pkcs11-helper.c vendor-crypto/openssh/dist/ssh-rand-helper.0 vendor-crypto/openssh/dist/ssh.0 vendor-crypto/openssh/dist/ssh.1 vendor-crypto/openssh/dist/ssh_config.0 vendor-crypto/openssh/dist/ssh_config.5 vendor-crypto/openssh/dist/sshd.0 vendor-crypto/openssh/dist/sshd_config.0 vendor-crypto/openssh/dist/version.h Modified: vendor-crypto/openssh/dist/ChangeLog ============================================================================== --- vendor-crypto/openssh/dist/ChangeLog Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/ChangeLog Wed Apr 28 08:37:00 2010 (r207311) @@ -1,4 +1,120 @@ -20100307 +20100410 + - (dtucker) [configure.ac] Put the check for the existence of getaddrinfo + back so we disable the IPv6 tests if we don't have it. + +20100409 + - (dtucker) [contrib/cygwin/Makefile] Don't overwrite files with the wrong + ones. Based on a patch from Roumen Petrov. + - (dtucker) [configure.ac] Bug #1744: use pkg-config for libedit flags if we + have it and the path is not provided to --with-libedit. Based on a patch + from Iain Morgan. + - (dtucker) [configure.ac defines.h loginrec.c logintest.c] Bug #1732: enable + utmpx support on FreeBSD where possible. Patch from Ed Schouten, ok djm@ + +20100326 + - (djm) [openbsd-compat/bsd-arc4random.c] Fix preprocessor detection + for arc4random_buf() and arc4random_uniform(); from Josh Gilkerson + - (dtucker) [configure.ac] Bug #1741: Add section for Haiku, patch originally + by Ingo Weinhold via Scott McCreary, ok djm@ + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/03/25 23:38:28 + [servconf.c] + from portable: getcwd(NULL, 0) doesn't work on all platforms, so + use a stack buffer; ok dtucker@ + - djm@cvs.openbsd.org 2010/03/26 00:26:58 + [ssh.1] + mention that -S none disables connection sharing; from Colin Watson + - (djm) [session.c] Allow ChrootDirectory to work on SELinux platforms - + set up SELinux execution context before chroot() call. From Russell + Coker via Colin watson; bz#1726 ok dtucker@ + - (djm) [channels.c] Check for EPFNOSUPPORT as a socket() errno; bz#1721 + ok dtucker@ + - (dtucker) Bug #1725: explicitly link libX11 into gnome-ssh-askpass2 using + pkg-config, patch from Colin Watson. Needed for newer linkers (ie gold). + - (djm) [contrib/ssh-copy-id] Don't blow up when the agent has no keys; + bz#1723 patch from Adeodato Simóvia Colin Watson; ok dtucker@ + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2010/03/26 01:06:13 + [ssh_config.5] + Reformat default value of PreferredAuthentications entry (current + formatting implies ", " is acceptable as a separator, which it's not. + ok djm@ + +20100324 + - (dtucker) [contrib/cygwin/ssh-host-config] Mount the Windows directory + containing the services file explicitely case-insensitive. This allows to + tweak the Windows services file reliably. Patch from vinschen at redhat. + +20100321 + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2010/03/08 09:41:27 + [ssh-keygen.1] + sort the list of constraints (to -O); ok djm + - jmc@cvs.openbsd.org 2010/03/10 07:40:35 + [ssh-keygen.1] + typos; from Ross Richardson + closes prs 6334 and 6335 + - djm@cvs.openbsd.org 2010/03/10 23:27:17 + [auth2-pubkey.c] + correct certificate logging and make it more consistent between + authorized_keys and TrustedCAKeys; ok markus@ + - djm@cvs.openbsd.org 2010/03/12 01:06:25 + [servconf.c] + unbreak AuthorizedKeys option with a $HOME-relative path; reported by + vinschen AT redhat.com, ok dtucker@ + - markus@cvs.openbsd.org 2010/03/12 11:37:40 + [servconf.c] + do not prepend AuthorizedKeysFile with getcwd(), unbreaks relative paths + free() (not xfree()) the buffer returned by getcwd() + - djm@cvs.openbsd.org 2010/03/13 21:10:38 + [clientloop.c] + protocol conformance fix: send language tag when disconnecting normally; + spotted by 1.41421 AT gmail.com, ok markus@ deraadt@ + - djm@cvs.openbsd.org 2010/03/13 21:45:46 + [ssh-keygen.1] + Certificates are named *-cert.pub, not *_cert.pub; committing a diff + from stevesk@ ok me + - jmc@cvs.openbsd.org 2010/03/13 23:38:13 + [ssh-keygen.1] + fix a formatting error (args need quoted); noted by stevesk + - stevesk@cvs.openbsd.org 2010/03/15 19:40:02 + [key.c key.h ssh-keygen.c] + also print certificate type (user or host) for ssh-keygen -L + ok djm kettenis + - stevesk@cvs.openbsd.org 2010/03/16 15:46:52 + [auth-options.c] + spelling in error message. ok djm kettenis + - djm@cvs.openbsd.org 2010/03/16 16:36:49 + [version.h] + crank version to openssh-5.5 since we have a few fixes since 5.4; + requested deraadt@ kettenis@ + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank version numbers + +20100314 + - (djm) [ssh-pkcs11-helper.c] Move #ifdef to after #defines to fix + compilation failure when !HAVE_DLOPEN. Reported by felix-mindrot + AT fefe.de + - (djm) [Makefile.in] Respecify -lssh after -lopenbsd-compat for + ssh-pkcs11-helper to repair static builds (we do the same for + ssh-keyscan). Reported by felix-mindrot AT fefe.de + +20100312 + - (tim) [Makefile.in] Now that scard is gone, no need to make $(datadir) + - (tim) [Makefile.in] Add missing $(EXEEXT) to install targets. + Patch from Corinna Vinschen. + - (tim) [contrib/cygwin/Makefile] Fix list of documentation files to install + on a Cygwin installation. Patch from Corinna Vinschen. + +20100311 + - (tim) [contrib/suse/openssh.spec] crank version number here too. + report by imorgan AT nas.nasa.gov + +20100309 + - (dtucker) [configure.ac] Use a proper AC_CHECK_DECL for BROKEN_GETADDRINFO + so setting it in CFLAGS correctly skips IPv6 tests. + +20100308 - (djm) OpenBSD CVS Sync - djm@cvs.openbsd.org 2010/03/07 22:16:01 [ssh-keygen.c] Modified: vendor-crypto/openssh/dist/Makefile.in ============================================================================== --- vendor-crypto/openssh/dist/Makefile.in Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/Makefile.in Wed Apr 28 08:37:00 2010 (r207311) @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.306 2010/02/24 07:18:51 djm Exp $ +# $Id: Makefile.in,v 1.309 2010/03/13 21:41:34 djm Exp $ # uncomment if you run a non bourne compatable shell. Ie. csh #SHELL = @SH@ @@ -160,7 +160,7 @@ ssh-keysign$(EXEEXT): $(LIBCOMPAT) libss $(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) ssh-pkcs11-helper$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-pkcs11-helper.o ssh-pkcs11.o - $(LD) -o $@ ssh-pkcs11-helper.o ssh-pkcs11.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) + $(LD) -o $@ ssh-pkcs11-helper.o ssh-pkcs11.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o roaming_dummy.o $(LD) -o $@ ssh-keyscan.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) @@ -249,26 +249,25 @@ install-files: $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) $(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir) - $(srcdir)/mkinstalldirs $(DESTDIR)$(datadir) $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)1 $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)5 $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)8 $(srcdir)/mkinstalldirs $(DESTDIR)$(libexecdir) (umask 022 ; $(srcdir)/mkinstalldirs $(DESTDIR)$(PRIVSEP_PATH)) - $(INSTALL) -m 0755 $(STRIP_OPT) ssh $(DESTDIR)$(bindir)/ssh - $(INSTALL) -m 0755 $(STRIP_OPT) scp $(DESTDIR)$(bindir)/scp - $(INSTALL) -m 0755 $(STRIP_OPT) ssh-add $(DESTDIR)$(bindir)/ssh-add - $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent $(DESTDIR)$(bindir)/ssh-agent - $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen $(DESTDIR)$(bindir)/ssh-keygen - $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan $(DESTDIR)$(bindir)/ssh-keyscan - $(INSTALL) -m 0755 $(STRIP_OPT) sshd $(DESTDIR)$(sbindir)/sshd + $(INSTALL) -m 0755 $(STRIP_OPT) ssh$(EXEEXT) $(DESTDIR)$(bindir)/ssh$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) scp$(EXEEXT) $(DESTDIR)$(bindir)/scp$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-add$(EXEEXT) $(DESTDIR)$(bindir)/ssh-add$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent$(EXEEXT) $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) sshd$(EXEEXT) $(DESTDIR)$(sbindir)/sshd$(EXEEXT) if test ! -z "$(INSTALL_SSH_RAND_HELPER)" ; then \ - $(INSTALL) -m 0755 $(STRIP_OPT) ssh-rand-helper $(DESTDIR)$(libexecdir)/ssh-rand-helper ; \ + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-rand-helper$(EXEEXT) $(DESTDIR)$(libexecdir)/ssh-rand-helper$(EXEEXT) ; \ fi - $(INSTALL) -m 4711 $(STRIP_OPT) ssh-keysign $(DESTDIR)$(SSH_KEYSIGN) - $(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper $(DESTDIR)$(SSH_PKCS11_HELPER) - $(INSTALL) -m 0755 $(STRIP_OPT) sftp $(DESTDIR)$(bindir)/sftp - $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server $(DESTDIR)$(SFTP_SERVER) + $(INSTALL) -m 4711 $(STRIP_OPT) ssh-keysign$(EXEEXT) $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper$(EXEEXT) $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) sftp$(EXEEXT) $(DESTDIR)$(bindir)/sftp$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 $(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 Modified: vendor-crypto/openssh/dist/README ============================================================================== --- vendor-crypto/openssh/dist/README Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/README Wed Apr 28 08:37:00 2010 (r207311) @@ -1,4 +1,4 @@ -See http://www.openssh.com/txt/release-5.4 for the release notes. +See http://www.openssh.com/txt/release-5.5 for the release notes. - A Japanese translation of this document and of the OpenSSH FAQ is - available at http://www.unixuser.org/~haruyama/security/openssh/index.html @@ -62,4 +62,4 @@ References - [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 [7] http://www.openssh.com/faq.html -$Id: README,v 1.72 2010/03/07 22:41:02 djm Exp $ +$Id: README,v 1.73 2010/03/21 19:11:55 djm Exp $ Modified: vendor-crypto/openssh/dist/auth-options.c ============================================================================== --- vendor-crypto/openssh/dist/auth-options.c Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/auth-options.c Wed Apr 28 08:37:00 2010 (r207311) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-options.c,v 1.48 2010/03/07 11:57:13 dtucker Exp $ */ +/* $OpenBSD: auth-options.c,v 1.49 2010/03/16 15:46:52 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -434,7 +434,7 @@ auth_cert_constraints(Buffer *c_orig, st goto out; } if (strlen(command) != clen) { - error("force-command constrain contains \\0"); + error("force-command constraint contains \\0"); goto out; } if (cert_forced_command != NULL) { @@ -454,7 +454,7 @@ auth_cert_constraints(Buffer *c_orig, st goto out; } if (strlen(allowed) != clen) { - error("source-address constrain contains \\0"); + error("source-address constraint contains \\0"); goto out; } if (cert_source_address_done++) { Modified: vendor-crypto/openssh/dist/auth2-pubkey.c ============================================================================== --- vendor-crypto/openssh/dist/auth2-pubkey.c Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/auth2-pubkey.c Wed Apr 28 08:37:00 2010 (r207311) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-pubkey.c,v 1.21 2010/03/04 10:36:03 djm Exp $ */ +/* $OpenBSD: auth2-pubkey.c,v 1.22 2010/03/10 23:27:17 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -240,22 +240,26 @@ user_key_allowed2(struct passwd *pw, Key continue; if (!key_equal(found, key->cert->signature_key)) continue; - debug("matching CA found: file %s, line %lu", - file, linenum); fp = key_fingerprint(found, SSH_FP_MD5, SSH_FP_HEX); - verbose("Found matching %s CA: %s", - key_type(found), fp); - xfree(fp); + debug("matching CA found: file %s, line %lu, %s %s", + file, linenum, key_type(found), fp); if (key_cert_check_authority(key, 0, 0, pw->pw_name, &reason) != 0) { + xfree(fp); error("%s", reason); auth_debug_add("%s", reason); continue; } if (auth_cert_constraints(&key->cert->constraints, - pw) != 0) + pw) != 0) { + xfree(fp); continue; + } + verbose("Accepted certificate ID \"%s\" " + "signed by %s CA %s via %s", key->cert->key_id, + key_type(found), fp, file); + xfree(fp); found_key = 1; break; } else if (!key_is_cert_authority && key_equal(found, key)) { @@ -281,15 +285,15 @@ user_key_allowed2(struct passwd *pw, Key static int user_cert_trusted_ca(struct passwd *pw, Key *key) { - char *key_fp, *ca_fp; + char *ca_fp; const char *reason; int ret = 0; if (!key_is_cert(key) || options.trusted_user_ca_keys == NULL) return 0; - key_fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); - ca_fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); + ca_fp = key_fingerprint(key->cert->signature_key, + SSH_FP_MD5, SSH_FP_HEX); if (key_in_file(key->cert->signature_key, options.trusted_user_ca_keys, 1) != 1) { @@ -306,13 +310,12 @@ user_cert_trusted_ca(struct passwd *pw, if (auth_cert_constraints(&key->cert->constraints, pw) != 0) goto out; - verbose("%s certificate %s allowed by trusted %s key %s", - key_type(key), key_fp, key_type(key->cert->signature_key), ca_fp); + verbose("Accepted certificate ID \"%s\" signed by %s CA %s via %s", + key->cert->key_id, key_type(key->cert->signature_key), ca_fp, + options.trusted_user_ca_keys); ret = 1; out: - if (key_fp != NULL) - xfree(key_fp); if (ca_fp != NULL) xfree(ca_fp); return ret; Modified: vendor-crypto/openssh/dist/channels.c ============================================================================== --- vendor-crypto/openssh/dist/channels.c Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/channels.c Wed Apr 28 08:37:00 2010 (r207311) @@ -3252,7 +3252,11 @@ x11_create_display_inet(int x11_display_ sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); if (sock < 0) { - if ((errno != EINVAL) && (errno != EAFNOSUPPORT)) { + if ((errno != EINVAL) && (errno != EAFNOSUPPORT) +#ifdef EPFNOSUPPORT + && (errno != EPFNOSUPPORT) +#endif + ) { error("socket: %.100s", strerror(errno)); freeaddrinfo(aitop); return -1; Modified: vendor-crypto/openssh/dist/clientloop.c ============================================================================== --- vendor-crypto/openssh/dist/clientloop.c Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/clientloop.c Wed Apr 28 08:37:00 2010 (r207311) @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.218 2010/01/28 00:21:18 djm Exp $ */ +/* $OpenBSD: clientloop.c,v 1.219 2010/03/13 21:10:38 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1484,6 +1484,7 @@ client_loop(int have_pty, int escape_cha packet_start(SSH2_MSG_DISCONNECT); packet_put_int(SSH2_DISCONNECT_BY_APPLICATION); packet_put_cstring("disconnected by user"); + packet_put_cstring(""); /* language tag */ packet_send(); packet_write_wait(); } Modified: vendor-crypto/openssh/dist/config.h.in ============================================================================== --- vendor-crypto/openssh/dist/config.h.in Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/config.h.in Wed Apr 28 08:37:00 2010 (r207311) @@ -80,9 +80,6 @@ /* Define if you want to specify the path to your lastlog file */ #undef CONF_LASTLOG_FILE -/* Define if you want to specify the path to your utmpx file */ -#undef CONF_UTMPX_FILE - /* Define if you want to specify the path to your utmp file */ #undef CONF_UTMP_FILE @@ -455,6 +452,9 @@ /* Define to 1 if you have the `getutxline' function. */ #undef HAVE_GETUTXLINE +/* Define to 1 if you have the `getutxuser' function. */ +#undef HAVE_GETUTXUSER + /* Define to 1 if you have the `get_default_context_with_level' function. */ #undef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL @@ -551,6 +551,9 @@ /* Define if system has libiaf that supports set_id */ #undef HAVE_LIBIAF +/* Define to 1 if you have the `network' library (-lnetwork). */ +#undef HAVE_LIBNETWORK + /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL @@ -804,6 +807,9 @@ /* Define to 1 if you have the `setutent' function. */ #undef HAVE_SETUTENT +/* Define to 1 if you have the `setutxdb' function. */ +#undef HAVE_SETUTXDB + /* Define to 1 if you have the `setutxent' function. */ #undef HAVE_SETUTXENT Modified: vendor-crypto/openssh/dist/configure ============================================================================== --- vendor-crypto/openssh/dist/configure Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/configure Wed Apr 28 08:37:00 2010 (r207311) @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 1.444 . +# From configure.ac Revision: 1.449 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for OpenSSH Portable. # @@ -693,6 +693,7 @@ LOGIN_PROGRAM_FALLBACK PATH_PASSWD_PROG LD SSHDLIBS +PKGCONFIG LIBEDIT INSTALL_SSH_RAND_HELPER SSH_PRIVSEP_USER @@ -7435,6 +7436,85 @@ fi *-*-dragonfly*) SSHDLIBS="$SSHDLIBS -lcrypt" ;; +*-*-haiku*) + LIBS="$LIBS -lbsd " + +{ echo "$as_me:$LINENO: checking for socket in -lnetwork" >&5 +echo $ECHO_N "checking for socket in -lnetwork... $ECHO_C" >&6; } +if test "${ac_cv_lib_network_socket+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnetwork $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_network_socket=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_network_socket=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_network_socket" >&5 +echo "${ECHO_T}$ac_cv_lib_network_socket" >&6; } +if test $ac_cv_lib_network_socket = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNETWORK 1 +_ACEOF + + LIBS="-lnetwork $LIBS" + +fi + + cat >>confdefs.h <<\_ACEOF +#define HAVE_U_INT64_T 1 +_ACEOF + + MANTYPE=man + ;; *-*-hpux*) # first we define all of the options common to all HP-UX releases CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" @@ -12326,7 +12406,61 @@ LIBEDIT_MSG="no" # Check whether --with-libedit was given. if test "${with_libedit+set}" = set; then withval=$with_libedit; if test "x$withval" != "xno" ; then - if test "x$withval" != "xyes"; then + if test "x$withval" = "xyes" ; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PKGCONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PKGCONFIG" && ac_cv_path_PKGCONFIG="no" + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { echo "$as_me:$LINENO: result: $PKGCONFIG" >&5 +echo "${ECHO_T}$PKGCONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + if test "x$PKGCONFIG" != "xno"; then + { echo "$as_me:$LINENO: checking if $PKGCONFIG knows about libedit" >&5 +echo $ECHO_N "checking if $PKGCONFIG knows about libedit... $ECHO_C" >&6; } + if "$PKGCONFIG" libedit; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + use_pkgconfig_for_libedit=yes + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + fi + else CPPFLAGS="$CPPFLAGS -I${withval}/include" if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" @@ -12334,13 +12468,20 @@ if test "${with_libedit+set}" = set; the LDFLAGS="-L${withval}/lib ${LDFLAGS}" fi fi + if test "x$use_pkgconfig_for_libedit" == "xyes"; then + LIBEDIT=`$PKGCONFIG --libs-only-l libedit` + CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`" + else + LIBEDIT="-ledit -lcurses" + fi + OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'` { echo "$as_me:$LINENO: checking for el_init in -ledit" >&5 echo $ECHO_N "checking for el_init in -ledit... $ECHO_C" >&6; } if test "${ac_cv_lib_edit_el_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ledit -lcurses +LIBS="-ledit $OTHERLIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -12402,7 +12543,6 @@ cat >>confdefs.h <<\_ACEOF #define USE_LIBEDIT 1 _ACEOF - LIBEDIT="-ledit -lcurses" LIBEDIT_MSG="yes" @@ -14961,7 +15101,8 @@ done -for ac_func in endutxent getutxent getutxid getutxline pututxline + +for ac_func in endutxent getutxent getutxid getutxline getutxuser pututxline do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -15056,7 +15197,8 @@ done -for ac_func in setutxent utmpxname + +for ac_func in setutxdb setutxent utmpxname do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -29373,8 +29515,8 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking if your system defines UTMPX_FILE" >&5 -echo $ECHO_N "checking if your system defines UTMPX_FILE... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking if your system defines WTMPX_FILE" >&5 +echo $ECHO_N "checking if your system defines WTMPX_FILE... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -29394,7 +29536,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { - char *utmpx = UTMPX_FILE; + char *wtmpx = WTMPX_FILE; ; return 0; } @@ -29424,48 +29566,59 @@ sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } - system_utmpx_path=no + system_wtmpx_path=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -if test -z "$conf_utmpx_location"; then - if test x"$system_utmpx_path" = x"no" ; then +if test -z "$conf_wtmpx_location"; then + if test x"$system_wtmpx_path" = x"no" ; then cat >>confdefs.h <<\_ACEOF -#define DISABLE_UTMPX 1 +#define DISABLE_WTMPX 1 _ACEOF fi else cat >>confdefs.h <<_ACEOF -#define CONF_UTMPX_FILE "$conf_utmpx_location" +#define CONF_WTMPX_FILE "$conf_wtmpx_location" _ACEOF fi -{ echo "$as_me:$LINENO: checking if your system defines WTMPX_FILE" >&5 -echo $ECHO_N "checking if your system defines WTMPX_FILE... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF + +if test ! -z "$blibpath" ; then + LDFLAGS="$LDFLAGS $blibflags$blibpath" + { echo "$as_me:$LINENO: WARNING: Please check and edit blibpath in LDFLAGS in Makefile" >&5 +echo "$as_me: WARNING: Please check and edit blibpath in LDFLAGS in Makefile" >&2;} +fi + +CFLAGS="$CFLAGS $werror_flags" + +if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then + TEST_SSH_IPV6=no +else + TEST_SSH_IPV6=yes +fi +{ echo "$as_me:$LINENO: checking whether BROKEN_GETADDRINFO is declared" >&5 +echo $ECHO_N "checking whether BROKEN_GETADDRINFO is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_BROKEN_GETADDRINFO+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#include -#include -#ifdef HAVE_UTMPX_H -#include -#endif -#ifdef HAVE_PATHS_H -# include -#endif - +$ac_includes_default int main () { - char *wtmpx = WTMPX_FILE; +#ifndef BROKEN_GETADDRINFO + (void) BROKEN_GETADDRINFO; +#endif + ; return 0; } @@ -29487,51 +29640,24 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + ac_cv_have_decl_BROKEN_GETADDRINFO=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - system_wtmpx_path=no - + ac_cv_have_decl_BROKEN_GETADDRINFO=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -if test -z "$conf_wtmpx_location"; then - if test x"$system_wtmpx_path" = x"no" ; then - cat >>confdefs.h <<\_ACEOF -#define DISABLE_WTMPX 1 -_ACEOF - - fi -else - -cat >>confdefs.h <<_ACEOF -#define CONF_WTMPX_FILE "$conf_wtmpx_location" -_ACEOF - fi - - -if test ! -z "$blibpath" ; then - LDFLAGS="$LDFLAGS $blibflags$blibpath" - { echo "$as_me:$LINENO: WARNING: Please check and edit blibpath in LDFLAGS in Makefile" >&5 -echo "$as_me: WARNING: Please check and edit blibpath in LDFLAGS in Makefile" >&2;} +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_BROKEN_GETADDRINFO" >&5 +echo "${ECHO_T}$ac_cv_have_decl_BROKEN_GETADDRINFO" >&6; } +if test $ac_cv_have_decl_BROKEN_GETADDRINFO = yes; then + TEST_SSH_IPV6=no fi -CFLAGS="$CFLAGS $werror_flags" +TEST_SSH_IPV6=$TEST_SSH_IPV6 -if grep "#define BROKEN_GETADDRINFO 1" confdefs.h >/dev/null || \ - test "x$ac_cv_func_getaddrinfo" != "xyes" ; then - TEST_SSH_IPV6=no - -else - TEST_SSH_IPV6=yes - -fi ac_config_files="$ac_config_files Makefile buildpkg.sh opensshd.init openssh.xml openbsd-compat/Makefile openbsd-compat/regress/Makefile ssh_prng_cmds survey.sh" @@ -30236,6 +30362,7 @@ LOGIN_PROGRAM_FALLBACK!$LOGIN_PROGRAM_FA PATH_PASSWD_PROG!$PATH_PASSWD_PROG$ac_delim LD!$LD$ac_delim SSHDLIBS!$SSHDLIBS$ac_delim +PKGCONFIG!$PKGCONFIG$ac_delim LIBEDIT!$LIBEDIT$ac_delim INSTALL_SSH_RAND_HELPER!$INSTALL_SSH_RAND_HELPER$ac_delim SSH_PRIVSEP_USER!$SSH_PRIVSEP_USER$ac_delim @@ -30255,7 +30382,6 @@ PROG_VMSTAT!$PROG_VMSTAT$ac_delim PROG_UPTIME!$PROG_UPTIME$ac_delim PROG_IPCS!$PROG_IPCS$ac_delim PROG_TAIL!$PROG_TAIL$ac_delim -INSTALL_SSH_PRNG_CMDS!$INSTALL_SSH_PRNG_CMDS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -30297,6 +30423,7 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +INSTALL_SSH_PRNG_CMDS!$INSTALL_SSH_PRNG_CMDS$ac_delim KRB5CONF!$KRB5CONF$ac_delim PRIVSEP_PATH!$PRIVSEP_PATH$ac_delim xauth_path!$xauth_path$ac_delim @@ -30312,7 +30439,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 13; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 14; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 Modified: vendor-crypto/openssh/dist/configure.ac ============================================================================== --- vendor-crypto/openssh/dist/configure.ac Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/configure.ac Wed Apr 28 08:37:00 2010 (r207311) @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.444 2010/03/05 04:04:35 djm Exp $ +# $Id: configure.ac,v 1.449 2010/04/10 12:58:01 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.444 $) +AC_REVISION($Revision: 1.449 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -488,6 +488,12 @@ main() { if (NSVersionOfRunTimeLibrary(" *-*-dragonfly*) SSHDLIBS="$SSHDLIBS -lcrypt" ;; +*-*-haiku*) + LIBS="$LIBS -lbsd " + AC_CHECK_LIB(network, socket) + AC_DEFINE(HAVE_U_INT64_T) + MANTYPE=man + ;; *-*-hpux*) # first we define all of the options common to all HP-UX releases CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" @@ -1248,7 +1254,18 @@ LIBEDIT_MSG="no" AC_ARG_WITH(libedit, [ --with-libedit[[=PATH]] Enable libedit support for sftp], [ if test "x$withval" != "xno" ; then - if test "x$withval" != "xyes"; then + if test "x$withval" = "xyes" ; then + AC_PATH_PROG(PKGCONFIG, pkg-config, no) + if test "x$PKGCONFIG" != "xno"; then + AC_MSG_CHECKING(if $PKGCONFIG knows about libedit) + if "$PKGCONFIG" libedit; then + AC_MSG_RESULT(yes) + use_pkgconfig_for_libedit=yes + else + AC_MSG_RESULT(no) + fi + fi + else CPPFLAGS="$CPPFLAGS -I${withval}/include" if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" @@ -1256,14 +1273,20 @@ AC_ARG_WITH(libedit, LDFLAGS="-L${withval}/lib ${LDFLAGS}" fi fi + if test "x$use_pkgconfig_for_libedit" == "xyes"; then + LIBEDIT=`$PKGCONFIG --libs-only-l libedit` + CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`" + else + LIBEDIT="-ledit -lcurses" + fi + OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'` AC_CHECK_LIB(edit, el_init, [ AC_DEFINE(USE_LIBEDIT, 1, [Use libedit for sftp]) - LIBEDIT="-ledit -lcurses" LIBEDIT_MSG="yes" AC_SUBST(LIBEDIT) ], [ AC_MSG_ERROR(libedit not found) ], - [ -lcurses ] + [ $OTHERLIBS ] ) AC_MSG_CHECKING(if libedit version is compatible) AC_COMPILE_IFELSE( @@ -1534,8 +1557,8 @@ dnl Checks for utmp functions AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent) AC_CHECK_FUNCS(utmpname) dnl Checks for utmpx functions -AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline ) -AC_CHECK_FUNCS(setutxent utmpxname) +AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline getutxuser pututxline) +AC_CHECK_FUNCS(setutxdb setutxent utmpxname) dnl Checks for lastlog functions AC_CHECK_FUNCS(getlastlogxbyname) @@ -4064,34 +4087,6 @@ if test -n "$conf_wtmp_location"; then fi -dnl utmpx detection - I don't know any system so perverse as to require -dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out -dnl there, though. -AC_MSG_CHECKING([if your system defines UTMPX_FILE]) -AC_TRY_COMPILE([ -#include -#include -#ifdef HAVE_UTMPX_H -#include -#endif -#ifdef HAVE_PATHS_H -# include -#endif - ], - [ char *utmpx = UTMPX_FILE; ], - [ AC_MSG_RESULT(yes) ], - [ AC_MSG_RESULT(no) - system_utmpx_path=no ] -) -if test -z "$conf_utmpx_location"; then - if test x"$system_utmpx_path" = x"no" ; then - AC_DEFINE(DISABLE_UTMPX) - fi -else - AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location", - [Define if you want to specify the path to your utmpx file]) -fi - dnl wtmpx detection AC_MSG_CHECKING([if your system defines WTMPX_FILE]) AC_TRY_COMPILE([ @@ -4128,12 +4123,13 @@ dnl Adding -Werror to CFLAGS early preve dnl Add now. CFLAGS="$CFLAGS $werror_flags" -if grep "#define BROKEN_GETADDRINFO 1" confdefs.h >/dev/null || \ - test "x$ac_cv_func_getaddrinfo" != "xyes" ; then - AC_SUBST(TEST_SSH_IPV6, no) +if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then + TEST_SSH_IPV6=no else - AC_SUBST(TEST_SSH_IPV6, yes) + TEST_SSH_IPV6=yes fi +AC_CHECK_DECL(BROKEN_GETADDRINFO, TEST_SSH_IPV6=no) +AC_SUBST(TEST_SSH_IPV6, $TEST_SSH_IPV6) AC_EXEEXT AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ Modified: vendor-crypto/openssh/dist/contrib/Makefile ============================================================================== --- vendor-crypto/openssh/dist/contrib/Makefile Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/contrib/Makefile Wed Apr 28 08:37:00 2010 (r207311) @@ -9,7 +9,7 @@ gnome-ssh-askpass1: gnome-ssh-askpass1.c gnome-ssh-askpass2: gnome-ssh-askpass2.c $(CC) `pkg-config --cflags gtk+-2.0` \ gnome-ssh-askpass2.c -o gnome-ssh-askpass2 \ - `pkg-config --libs gtk+-2.0` + `pkg-config --libs gtk+-2.0 x11` clean: rm -f *.o gnome-ssh-askpass1 gnome-ssh-askpass2 gnome-ssh-askpass Modified: vendor-crypto/openssh/dist/contrib/caldera/openssh.spec ============================================================================== --- vendor-crypto/openssh/dist/contrib/caldera/openssh.spec Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/contrib/caldera/openssh.spec Wed Apr 28 08:37:00 2010 (r207311) @@ -17,11 +17,11 @@ #old cvs stuff. please update before use. may be deprecated. %define use_stable 1 %if %{use_stable} - %define version 5.4p1 + %define version 5.5p1 %define cvs %{nil} %define release 1 %else - %define version 5.4p1 + %define version 5.5p1 %define cvs cvs20050315 %define release 0r1 %endif @@ -360,4 +360,4 @@ fi * Mon Jan 01 1998 ... Template Version: 1.31 -$Id: openssh.spec,v 1.69 2010/03/07 22:41:03 djm Exp $ +$Id: openssh.spec,v 1.70 2010/03/21 19:11:58 djm Exp $ Modified: vendor-crypto/openssh/dist/contrib/cygwin/Makefile ============================================================================== --- vendor-crypto/openssh/dist/contrib/cygwin/Makefile Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/contrib/cygwin/Makefile Wed Apr 28 08:37:00 2010 (r207311) @@ -42,11 +42,13 @@ install-sshdoc: $(INSTALL) -m 644 $(srcdir)/OVERVIEW $(DESTDIR)$(sshdocdir)/OVERVIEW $(INSTALL) -m 644 $(srcdir)/PROTOCOL $(DESTDIR)$(sshdocdir)/PROTOCOL $(INSTALL) -m 644 $(srcdir)/PROTOCOL.agent $(DESTDIR)$(sshdocdir)/PROTOCOL.agent + $(INSTALL) -m 644 $(srcdir)/PROTOCOL.certkeys $(DESTDIR)$(sshdocdir)/PROTOCOL.certkeys + $(INSTALL) -m 644 $(srcdir)/PROTOCOL.mux $(DESTDIR)$(sshdocdir)/PROTOCOL.mux $(INSTALL) -m 644 $(srcdir)/README $(DESTDIR)$(sshdocdir)/README $(INSTALL) -m 644 $(srcdir)/README.dns $(DESTDIR)$(sshdocdir)/README.dns $(INSTALL) -m 644 $(srcdir)/README.platform $(DESTDIR)$(sshdocdir)/README.platform $(INSTALL) -m 644 $(srcdir)/README.privsep $(DESTDIR)$(sshdocdir)/README.privsep - $(INSTALL) -m 644 $(srcdir)/README.smartcard $(DESTDIR)$(sshdocdir)/README.smartcard + $(INSTALL) -m 644 $(srcdir)/README.tun $(DESTDIR)$(sshdocdir)/README.tun $(INSTALL) -m 644 $(srcdir)/TODO $(DESTDIR)$(sshdocdir)/TODO $(INSTALL) -m 644 $(srcdir)/WARNING.RNG $(DESTDIR)$(sshdocdir)/WARNING.RNG Modified: vendor-crypto/openssh/dist/contrib/cygwin/ssh-host-config ============================================================================== --- vendor-crypto/openssh/dist/contrib/cygwin/ssh-host-config Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/contrib/cygwin/ssh-host-config Wed Apr 28 08:37:00 2010 (r207311) @@ -90,7 +90,7 @@ update_services_file() { fi _serv_tmp="${_my_etcdir}/srv.out.$$" - mount -o text -f "${_win_etcdir}" "${_my_etcdir}" + mount -o text,posix=0,noacl -f "${_win_etcdir}" "${_my_etcdir}" # Depends on the above mount _wservices=`cygpath -w "${_services}"` Modified: vendor-crypto/openssh/dist/contrib/redhat/openssh.spec ============================================================================== --- vendor-crypto/openssh/dist/contrib/redhat/openssh.spec Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/contrib/redhat/openssh.spec Wed Apr 28 08:37:00 2010 (r207311) @@ -1,4 +1,4 @@ -%define ver 5.4p1 +%define ver 5.5p1 %define rel 1 # OpenSSH privilege separation requires a user & group ID Modified: vendor-crypto/openssh/dist/contrib/ssh-copy-id ============================================================================== --- vendor-crypto/openssh/dist/contrib/ssh-copy-id Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/contrib/ssh-copy-id Wed Apr 28 08:37:00 2010 (r207311) @@ -19,7 +19,7 @@ if [ "-i" = "$1" ]; then shift # and this should leave $1 as the target name fi else - if [ x$SSH_AUTH_SOCK != x ] ; then + if [ x$SSH_AUTH_SOCK != x ] && ssh-add -L >/dev/null 2>&1; then GET_ID="$GET_ID ssh-add -L" fi fi Modified: vendor-crypto/openssh/dist/contrib/suse/openssh.spec ============================================================================== --- vendor-crypto/openssh/dist/contrib/suse/openssh.spec Wed Apr 28 07:57:37 2010 (r207310) +++ vendor-crypto/openssh/dist/contrib/suse/openssh.spec Wed Apr 28 08:37:00 2010 (r207311) @@ -13,7 +13,7 @@ Summary: OpenSSH, a free Secure Shell (SSH) protocol implementation Name: openssh *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 08:39:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BB171065670; Wed, 28 Apr 2010 08:39:12 +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 7691E8FC12; Wed, 28 Apr 2010 08:39: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 o3S8dCZE075574; Wed, 28 Apr 2010 08:39:12 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3S8dCLr075571; Wed, 28 Apr 2010 08:39:12 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201004280839.o3S8dCLr075571@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 28 Apr 2010 08:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207312 - in vendor-crypto/openssh/5.5p1: . contrib contrib/caldera contrib/cygwin contrib/redhat contrib/suse openbsd-compat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 08:39:12 -0000 Author: des Date: Wed Apr 28 08:39:12 2010 New Revision: 207312 URL: http://svn.freebsd.org/changeset/base/207312 Log: Tag OpenSSH 5.5p1 Added: vendor-crypto/openssh/5.5p1/ - copied from r207310, vendor-crypto/openssh/dist/ Replaced: vendor-crypto/openssh/5.5p1/ChangeLog - copied unchanged from r207311, vendor-crypto/openssh/dist/ChangeLog vendor-crypto/openssh/5.5p1/Makefile.in - copied unchanged from r207311, vendor-crypto/openssh/dist/Makefile.in vendor-crypto/openssh/5.5p1/README - copied unchanged from r207311, vendor-crypto/openssh/dist/README vendor-crypto/openssh/5.5p1/auth-options.c - copied unchanged from r207311, vendor-crypto/openssh/dist/auth-options.c vendor-crypto/openssh/5.5p1/auth2-pubkey.c - copied unchanged from r207311, vendor-crypto/openssh/dist/auth2-pubkey.c vendor-crypto/openssh/5.5p1/channels.c - copied unchanged from r207311, vendor-crypto/openssh/dist/channels.c vendor-crypto/openssh/5.5p1/clientloop.c - copied unchanged from r207311, vendor-crypto/openssh/dist/clientloop.c vendor-crypto/openssh/5.5p1/config.h.in - copied unchanged from r207311, vendor-crypto/openssh/dist/config.h.in vendor-crypto/openssh/5.5p1/configure - copied unchanged from r207311, vendor-crypto/openssh/dist/configure vendor-crypto/openssh/5.5p1/configure.ac - copied unchanged from r207311, vendor-crypto/openssh/dist/configure.ac vendor-crypto/openssh/5.5p1/contrib/Makefile - copied unchanged from r207311, vendor-crypto/openssh/dist/contrib/Makefile vendor-crypto/openssh/5.5p1/contrib/caldera/openssh.spec - copied unchanged from r207311, vendor-crypto/openssh/dist/contrib/caldera/openssh.spec vendor-crypto/openssh/5.5p1/contrib/cygwin/Makefile - copied unchanged from r207311, vendor-crypto/openssh/dist/contrib/cygwin/Makefile vendor-crypto/openssh/5.5p1/contrib/cygwin/ssh-host-config - copied unchanged from r207311, vendor-crypto/openssh/dist/contrib/cygwin/ssh-host-config vendor-crypto/openssh/5.5p1/contrib/redhat/openssh.spec - copied unchanged from r207311, vendor-crypto/openssh/dist/contrib/redhat/openssh.spec vendor-crypto/openssh/5.5p1/contrib/ssh-copy-id - copied unchanged from r207311, vendor-crypto/openssh/dist/contrib/ssh-copy-id vendor-crypto/openssh/5.5p1/contrib/suse/openssh.spec - copied unchanged from r207311, vendor-crypto/openssh/dist/contrib/suse/openssh.spec vendor-crypto/openssh/5.5p1/defines.h - copied unchanged from r207311, vendor-crypto/openssh/dist/defines.h vendor-crypto/openssh/5.5p1/key.c - copied unchanged from r207311, vendor-crypto/openssh/dist/key.c vendor-crypto/openssh/5.5p1/key.h - copied unchanged from r207311, vendor-crypto/openssh/dist/key.h vendor-crypto/openssh/5.5p1/loginrec.c - copied unchanged from r207311, vendor-crypto/openssh/dist/loginrec.c vendor-crypto/openssh/5.5p1/logintest.c - copied unchanged from r207311, vendor-crypto/openssh/dist/logintest.c vendor-crypto/openssh/5.5p1/moduli.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/moduli.0 vendor-crypto/openssh/5.5p1/openbsd-compat/bsd-arc4random.c - copied unchanged from r207311, vendor-crypto/openssh/dist/openbsd-compat/bsd-arc4random.c vendor-crypto/openssh/5.5p1/scp.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/scp.0 vendor-crypto/openssh/5.5p1/servconf.c - copied unchanged from r207311, vendor-crypto/openssh/dist/servconf.c vendor-crypto/openssh/5.5p1/session.c - copied unchanged from r207311, vendor-crypto/openssh/dist/session.c vendor-crypto/openssh/5.5p1/sftp-server.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/sftp-server.0 vendor-crypto/openssh/5.5p1/sftp.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/sftp.0 vendor-crypto/openssh/5.5p1/ssh-add.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh-add.0 vendor-crypto/openssh/5.5p1/ssh-agent.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh-agent.0 vendor-crypto/openssh/5.5p1/ssh-keygen.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh-keygen.0 vendor-crypto/openssh/5.5p1/ssh-keygen.1 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh-keygen.1 vendor-crypto/openssh/5.5p1/ssh-keygen.c - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh-keygen.c vendor-crypto/openssh/5.5p1/ssh-keyscan.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh-keyscan.0 vendor-crypto/openssh/5.5p1/ssh-keysign.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh-keysign.0 vendor-crypto/openssh/5.5p1/ssh-pkcs11-helper.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh-pkcs11-helper.0 vendor-crypto/openssh/5.5p1/ssh-pkcs11-helper.c - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh-pkcs11-helper.c vendor-crypto/openssh/5.5p1/ssh-rand-helper.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh-rand-helper.0 vendor-crypto/openssh/5.5p1/ssh.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh.0 vendor-crypto/openssh/5.5p1/ssh.1 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh.1 vendor-crypto/openssh/5.5p1/ssh_config.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh_config.0 vendor-crypto/openssh/5.5p1/ssh_config.5 - copied unchanged from r207311, vendor-crypto/openssh/dist/ssh_config.5 vendor-crypto/openssh/5.5p1/sshd.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/sshd.0 vendor-crypto/openssh/5.5p1/sshd_config.0 - copied unchanged from r207311, vendor-crypto/openssh/dist/sshd_config.0 vendor-crypto/openssh/5.5p1/version.h - copied unchanged from r207311, vendor-crypto/openssh/dist/version.h Copied: vendor-crypto/openssh/5.5p1/ChangeLog (from r207311, vendor-crypto/openssh/dist/ChangeLog) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-crypto/openssh/5.5p1/ChangeLog Wed Apr 28 08:39:12 2010 (r207312, copy of r207311, vendor-crypto/openssh/dist/ChangeLog) @@ -0,0 +1,2743 @@ +20100410 + - (dtucker) [configure.ac] Put the check for the existence of getaddrinfo + back so we disable the IPv6 tests if we don't have it. + +20100409 + - (dtucker) [contrib/cygwin/Makefile] Don't overwrite files with the wrong + ones. Based on a patch from Roumen Petrov. + - (dtucker) [configure.ac] Bug #1744: use pkg-config for libedit flags if we + have it and the path is not provided to --with-libedit. Based on a patch + from Iain Morgan. + - (dtucker) [configure.ac defines.h loginrec.c logintest.c] Bug #1732: enable + utmpx support on FreeBSD where possible. Patch from Ed Schouten, ok djm@ + +20100326 + - (djm) [openbsd-compat/bsd-arc4random.c] Fix preprocessor detection + for arc4random_buf() and arc4random_uniform(); from Josh Gilkerson + - (dtucker) [configure.ac] Bug #1741: Add section for Haiku, patch originally + by Ingo Weinhold via Scott McCreary, ok djm@ + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/03/25 23:38:28 + [servconf.c] + from portable: getcwd(NULL, 0) doesn't work on all platforms, so + use a stack buffer; ok dtucker@ + - djm@cvs.openbsd.org 2010/03/26 00:26:58 + [ssh.1] + mention that -S none disables connection sharing; from Colin Watson + - (djm) [session.c] Allow ChrootDirectory to work on SELinux platforms - + set up SELinux execution context before chroot() call. From Russell + Coker via Colin watson; bz#1726 ok dtucker@ + - (djm) [channels.c] Check for EPFNOSUPPORT as a socket() errno; bz#1721 + ok dtucker@ + - (dtucker) Bug #1725: explicitly link libX11 into gnome-ssh-askpass2 using + pkg-config, patch from Colin Watson. Needed for newer linkers (ie gold). + - (djm) [contrib/ssh-copy-id] Don't blow up when the agent has no keys; + bz#1723 patch from Adeodato Simóvia Colin Watson; ok dtucker@ + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2010/03/26 01:06:13 + [ssh_config.5] + Reformat default value of PreferredAuthentications entry (current + formatting implies ", " is acceptable as a separator, which it's not. + ok djm@ + +20100324 + - (dtucker) [contrib/cygwin/ssh-host-config] Mount the Windows directory + containing the services file explicitely case-insensitive. This allows to + tweak the Windows services file reliably. Patch from vinschen at redhat. + +20100321 + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2010/03/08 09:41:27 + [ssh-keygen.1] + sort the list of constraints (to -O); ok djm + - jmc@cvs.openbsd.org 2010/03/10 07:40:35 + [ssh-keygen.1] + typos; from Ross Richardson + closes prs 6334 and 6335 + - djm@cvs.openbsd.org 2010/03/10 23:27:17 + [auth2-pubkey.c] + correct certificate logging and make it more consistent between + authorized_keys and TrustedCAKeys; ok markus@ + - djm@cvs.openbsd.org 2010/03/12 01:06:25 + [servconf.c] + unbreak AuthorizedKeys option with a $HOME-relative path; reported by + vinschen AT redhat.com, ok dtucker@ + - markus@cvs.openbsd.org 2010/03/12 11:37:40 + [servconf.c] + do not prepend AuthorizedKeysFile with getcwd(), unbreaks relative paths + free() (not xfree()) the buffer returned by getcwd() + - djm@cvs.openbsd.org 2010/03/13 21:10:38 + [clientloop.c] + protocol conformance fix: send language tag when disconnecting normally; + spotted by 1.41421 AT gmail.com, ok markus@ deraadt@ + - djm@cvs.openbsd.org 2010/03/13 21:45:46 + [ssh-keygen.1] + Certificates are named *-cert.pub, not *_cert.pub; committing a diff + from stevesk@ ok me + - jmc@cvs.openbsd.org 2010/03/13 23:38:13 + [ssh-keygen.1] + fix a formatting error (args need quoted); noted by stevesk + - stevesk@cvs.openbsd.org 2010/03/15 19:40:02 + [key.c key.h ssh-keygen.c] + also print certificate type (user or host) for ssh-keygen -L + ok djm kettenis + - stevesk@cvs.openbsd.org 2010/03/16 15:46:52 + [auth-options.c] + spelling in error message. ok djm kettenis + - djm@cvs.openbsd.org 2010/03/16 16:36:49 + [version.h] + crank version to openssh-5.5 since we have a few fixes since 5.4; + requested deraadt@ kettenis@ + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank version numbers + +20100314 + - (djm) [ssh-pkcs11-helper.c] Move #ifdef to after #defines to fix + compilation failure when !HAVE_DLOPEN. Reported by felix-mindrot + AT fefe.de + - (djm) [Makefile.in] Respecify -lssh after -lopenbsd-compat for + ssh-pkcs11-helper to repair static builds (we do the same for + ssh-keyscan). Reported by felix-mindrot AT fefe.de + +20100312 + - (tim) [Makefile.in] Now that scard is gone, no need to make $(datadir) + - (tim) [Makefile.in] Add missing $(EXEEXT) to install targets. + Patch from Corinna Vinschen. + - (tim) [contrib/cygwin/Makefile] Fix list of documentation files to install + on a Cygwin installation. Patch from Corinna Vinschen. + +20100311 + - (tim) [contrib/suse/openssh.spec] crank version number here too. + report by imorgan AT nas.nasa.gov + +20100309 + - (dtucker) [configure.ac] Use a proper AC_CHECK_DECL for BROKEN_GETADDRINFO + so setting it in CFLAGS correctly skips IPv6 tests. + +20100308 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/03/07 22:16:01 + [ssh-keygen.c] + make internal strptime string match strftime format; + suggested by vinschen AT redhat.com and markus@ + - djm@cvs.openbsd.org 2010/03/08 00:28:55 + [ssh-keygen.1] + document permit-agent-forwarding certificate constraint; patch from + stevesk@ + - djm@cvs.openbsd.org 2010/03/07 22:01:32 + [version.h] + openssh-5.4 + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + crank version numbers + - (djm) Release OpenSSH-5.4p1 + +20100307 + - (dtucker) [auth.c] Bug #1710: call setauthdb on AIX before getpwuid so that + it gets the passwd struct from the LAM that knows about the user which is + not necessarily the default. Patch from Alexandre Letourneau. + - (dtucker) [session.c] Bug #1567: move setpcred call to before chroot and + do not set real uid, since that's needed for the chroot, and will be set + by permanently_set_uid. + - (dtucker) [session.c] Also initialize creds to NULL for handing to + setpcred. + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2010/03/07 11:57:13 + [auth-rhosts.c monitor.c monitor_wrap.c session.c auth-options.c sshd.c] + Hold authentication debug messages until after successful authentication. + Fixes an info leak of environment variables specified in authorized_keys, + reported by Jacob Appelbaum. ok djm@ + +20100305 + - OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2010/03/04 12:51:25 + [ssh.1 sshd_config.5] + tweak previous; + - djm@cvs.openbsd.org 2010/03/04 20:35:08 + [ssh-keygen.1 ssh-keygen.c] + Add a -L flag to print the contents of a certificate; ok markus@ + - jmc@cvs.openbsd.org 2010/03/04 22:52:40 + [ssh-keygen.1] + fix Bk/Ek; + - djm@cvs.openbsd.org 2010/03/04 23:17:25 + [sshd_config.5] + missing word; spotted by jmc@ + - djm@cvs.openbsd.org 2010/03/04 23:19:29 + [ssh.1 sshd.8] + move section on CA and revoked keys from ssh.1 to sshd.8's known hosts + format section and rework it a bit; requested by jmc@ + - djm@cvs.openbsd.org 2010/03/04 23:27:25 + [auth-options.c ssh-keygen.c] + "force-command" is not spelled "forced-command"; spotted by + imorgan AT nas.nasa.gov + - djm@cvs.openbsd.org 2010/03/05 02:58:11 + [auth.c] + make the warning for a revoked key louder and more noticable + - jmc@cvs.openbsd.org 2010/03/05 06:50:35 + [ssh.1 sshd.8] + tweak previous; + - jmc@cvs.openbsd.org 2010/03/05 08:31:20 + [ssh.1] + document certificate authentication; help/ok djm + - djm@cvs.openbsd.org 2010/03/05 10:28:21 + [ssh-add.1 ssh.1 ssh_config.5] + mention loading of certificate files from [private]-cert.pub when + they are present; feedback and ok jmc@ + - (tim) [ssh-pkcs11.c] Fix "non-constant initializer" errors in older + compilers. OK djm@ + - (djm) [ssh-rand-helper.c] declare optind, avoiding compilation failure + on some platforms + - (djm) [configure.ac] set -fno-strict-aliasing for gcc4; ok dtucker@ + +20100304 + - (djm) [ssh-keygen.c] Use correct local variable, instead of + maybe-undefined global "optarg" + - (djm) [contrib/redhat/openssh.spec] Replace obsolete BuildPreReq + on XFree86-devel with neutral /usr/include/X11/Xlib.h; + imorgan AT nas.nasa.gov in bz#1731 + - (djm) [.cvsignore] Ignore ssh-pkcs11-helper + - (djm) [regress/Makefile] Cleanup sshd_proxy_orig + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/03/03 01:44:36 + [auth-options.c key.c] + reject strings with embedded ASCII nul chars in certificate key IDs, + principal names and constraints + - djm@cvs.openbsd.org 2010/03/03 22:49:50 + [sshd.8] + the authorized_keys option for CA keys is "cert-authority", not + "from=cert-authority". spotted by imorgan AT nas.nasa.gov + - djm@cvs.openbsd.org 2010/03/03 22:50:40 + [PROTOCOL.certkeys] + s/similar same/similar/; from imorgan AT nas.nasa.gov + - djm@cvs.openbsd.org 2010/03/04 01:44:57 + [key.c] + use buffer_get_string_ptr_ret() where we are checking the return + value explicitly instead of the fatal()-causing buffer_get_string_ptr() + - djm@cvs.openbsd.org 2010/03/04 10:36:03 + [auth-rh-rsa.c auth-rsa.c auth.c auth.h auth2-hostbased.c auth2-pubkey.c] + [authfile.c authfile.h hostfile.c hostfile.h servconf.c servconf.h] + [ssh-keygen.c ssh.1 sshconnect.c sshd_config.5] + Add a TrustedUserCAKeys option to sshd_config to specify CA keys that + are trusted to authenticate users (in addition than doing it per-user + in authorized_keys). + + Add a RevokedKeys option to sshd_config and a @revoked marker to + known_hosts to allow keys to me revoked and banned for user or host + authentication. + + feedback and ok markus@ + - djm@cvs.openbsd.org 2010/03/03 00:47:23 + [regress/cert-hostkey.sh regress/cert-userkey.sh] + add an extra test to ensure that authentication with the wrong + certificate fails as it should (and it does) + - djm@cvs.openbsd.org 2010/03/04 10:38:23 + [regress/cert-hostkey.sh regress/cert-userkey.sh] + additional regression tests for revoked keys and TrustedUserCAKeys + +20100303 + - (djm) [PROTOCOL.certkeys] Add RCS Ident + - OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2010/02/26 22:09:28 + [ssh-keygen.1 ssh.1 sshd.8] + tweak previous; + - otto@cvs.openbsd.org 2010/03/01 11:07:06 + [ssh-add.c] + zap what seems to be a left-over debug message; ok markus@ + - djm@cvs.openbsd.org 2010/03/02 23:20:57 + [ssh-keygen.c] + POSIX strptime is stricter than OpenBSD's so do a little dance to + appease it. + - (djm) [regress/cert-userkey.sh] s/echo -n/echon/ here too + +20100302 + - (tim) [config.guess config.sub] Bug 1722: Update to latest versions from + http://git.savannah.gnu.org/gitweb/ (2009-12-30 and 2010-01-22 + respectively). + +20100301 + - (dtucker) [regress/{cert-hostkey,cfgmatch,cipher-speed}.sh} Replace + "echo -n" with "echon" for portability. + - (dtucker) [openbsd-compat/port-linux.c] Make failure to write to the OOM + adjust log at verbose only, since according to cjwatson in bug #1470 + some virtualization platforms don't allow writes. + +20100228 + - (djm) [auth.c] On Cygwin, refuse usernames that have differences in + case from that matched in the system password database. On this + platform, passwords are stored case-insensitively, but sshd requires + exact case matching for Match blocks in sshd_config(5). Based on + a patch from vinschen AT redhat.com. + - (tim) [ssh-pkcs11-helper.c] Move declarations before calling functions + to make older compilers (gcc 2.95) happy. + +20100227 + - (djm) [ssh-pkcs11-helper.c ] Ensure RNG is initialised and seeded + - (djm) [openbsd-compat/bsd-cygwin_util.c] Reduce the set of environment + variables copied into sshd child processes. From vinschen AT redhat.com + +20100226 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/02/26 20:29:54 + [PROTOCOL PROTOCOL.agent PROTOCOL.certkeys addrmatch.c auth-options.c] + [auth-options.h auth.h auth2-pubkey.c authfd.c dns.c dns.h hostfile.c] + [hostfile.h kex.h kexdhs.c kexgexs.c key.c key.h match.h monitor.c] + [myproposal.h servconf.c servconf.h ssh-add.c ssh-agent.c ssh-dss.c] + [ssh-keygen.1 ssh-keygen.c ssh-rsa.c ssh.1 ssh.c ssh2.h sshconnect.c] + [sshconnect2.c sshd.8 sshd.c sshd_config.5] + Add support for certificate key types for users and hosts. + + OpenSSH certificate key types are not X.509 certificates, but a much + simpler format that encodes a public key, identity information and + some validity constraints and signs it with a CA key. CA keys are + regular SSH keys. This certificate style avoids the attack surface + of X.509 certificates and is very easy to deploy. + + Certified host keys allow automatic acceptance of new host keys + when a CA certificate is marked as trusted in ~/.ssh/known_hosts. + see VERIFYING HOST KEYS in ssh(1) for details. + + Certified user keys allow authentication of users when the signing + CA key is marked as trusted in authorized_keys. See "AUTHORIZED_KEYS + FILE FORMAT" in sshd(8) for details. + + Certificates are minted using ssh-keygen(1), documentation is in + the "CERTIFICATES" section of that manpage. + + Documentation on the format of certificates is in the file + PROTOCOL.certkeys + + feedback and ok markus@ + - djm@cvs.openbsd.org 2010/02/26 20:33:21 + [Makefile regress/cert-hostkey.sh regress/cert-userkey.sh] + regression tests for certified keys + +20100224 + - (djm) [pkcs11.h ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c] + [ssh-pkcs11.h] Add $OpenBSD$ RCS idents so we can sync portable + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/02/11 20:37:47 + [pathnames.h] + correct comment + - dtucker@cvs.openbsd.org 2009/11/09 04:20:04 + [regress/Makefile] + add regression test for ssh-keygen pubkey conversions + - dtucker@cvs.openbsd.org 2010/01/11 02:53:44 + [regress/forwarding.sh] + regress test for stdio forwarding + - djm@cvs.openbsd.org 2010/02/09 04:57:36 + [regress/addrmatch.sh] + clean up droppings + - djm@cvs.openbsd.org 2010/02/09 06:29:02 + [regress/Makefile] + turn on all the malloc(3) checking options when running regression + tests. this has caught a few bugs for me in the past; ok dtucker@ + - djm@cvs.openbsd.org 2010/02/24 06:21:56 + [regress/test-exec.sh] + wait for sshd to fully stop in cleanup() function; avoids races in tests + that do multiple start_sshd/cleanup cycles; "I hate pidfiles" deraadt@ + - markus@cvs.openbsd.org 2010/02/08 10:52:47 + [regress/agent-pkcs11.sh] + test for PKCS#11 support (currently disabled) + - (djm) [Makefile.in ssh-pkcs11-helper.8] Add manpage for PKCS#11 helper + - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Add PKCS#11 helper binary and manpage + +20100212 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/02/02 22:49:34 + [bufaux.c] + make buffer_get_string_ret() really non-fatal in all cases (it was + using buffer_get_int(), which could fatal() on buffer empty); + ok markus dtucker + - markus@cvs.openbsd.org 2010/02/08 10:50:20 + [pathnames.h readconf.c readconf.h scp.1 sftp.1 ssh-add.1 ssh-add.c] + [ssh-agent.c ssh-keygen.1 ssh-keygen.c ssh.1 ssh.c ssh_config.5] + replace our obsolete smartcard code with PKCS#11. + ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs-11v2-20.pdf + ssh(1) and ssh-keygen(1) use dlopen(3) directly to talk to a PKCS#11 + provider (shared library) while ssh-agent(1) delegates PKCS#11 to + a forked a ssh-pkcs11-helper process. + PKCS#11 is currently a compile time option. + feedback and ok djm@; inspired by patches from Alon Bar-Lev + - jmc@cvs.openbsd.org 2010/02/08 22:03:05 + [ssh-add.1 ssh-keygen.1 ssh.1 ssh.c] + tweak previous; ok markus + - djm@cvs.openbsd.org 2010/02/09 00:50:36 + [ssh-agent.c] + fallout from PKCS#11: unbreak -D + - djm@cvs.openbsd.org 2010/02/09 00:50:59 + [ssh-keygen.c] + fix -Wall + - djm@cvs.openbsd.org 2010/02/09 03:56:28 + [buffer.c buffer.h] + constify the arguments to buffer_len, buffer_ptr and buffer_dump + - djm@cvs.openbsd.org 2010/02/09 06:18:46 + [auth.c] + unbreak ChrootDirectory+internal-sftp by skipping check for executable + shell when chrooting; reported by danh AT wzrd.com; ok dtucker@ + - markus@cvs.openbsd.org 2010/02/10 23:20:38 + [ssh-add.1 ssh-keygen.1 ssh.1 ssh_config.5] + pkcs#11 is no longer optional; improve wording; ok jmc@ + - jmc@cvs.openbsd.org 2010/02/11 13:23:29 + [ssh.1] + libarary -> library; + - (djm) [INSTALL Makefile.in README.smartcard configure.ac scard-opensc.c] + [scard.c scard.h pkcs11.h scard/Makefile.in scard/Ssh.bin.uu scard/Ssh.java] + Remove obsolete smartcard support + - (djm) [ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c] + Make it compile on OSX + - (djm) [ssh-pkcs11-client.c ssh-pkcs11-helper.c ssh-pkcs11.c] + Use ssh_get_progname to fill __progname + - (djm) [configure.ac] Enable PKCS#11 support only when we find a working + dlopen() + +20100210 + - (djm) add -lselinux to LIBS before calling AC_CHECK_FUNCS for + getseuserbyname; patch from calebcase AT gmail.com via + cjwatson AT debian.org + +20100202 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/01/30 21:08:33 + [sshd.8] + debug output goes to stderr, not "the system log"; ok markus dtucker + - djm@cvs.openbsd.org 2010/01/30 21:12:08 + [channels.c] + fake local addr:port when stdio fowarding as some servers (Tectia at + least) validate that they are well-formed; + reported by imorgan AT nas.nasa.gov + ok dtucker + +20100130 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/01/28 00:21:18 + [clientloop.c] + downgrade an error() to a debug() - this particular case can be hit in + normal operation for certain sequences of mux slave vs session closure + and is harmless + - djm@cvs.openbsd.org 2010/01/29 00:20:41 + [sshd.c] + set FD_CLOEXEC on sock_in/sock_out; bz#1706 from jchadima AT redhat.com + ok dtucker@ + - djm@cvs.openbsd.org 2010/01/29 20:16:17 + [mux.c] + kill correct channel (was killing already-dead mux channel, not + its session channel) + - djm@cvs.openbsd.org 2010/01/30 02:54:53 + [mux.c] + don't mark channel as read failed if it is already closing; suppresses + harmless error messages when connecting to SSH.COM Tectia server + report by imorgan AT nas.nasa.gov + +20100129 + - (dtucker) [openbsd-compat/openssl-compat.c] Bug #1707: Call OPENSSL_config() + after registering the hardware engines, which causes the openssl.cnf file to + be processed. See OpenSSL's man page for OPENSSL_config(3) for details. + Patch from Solomon Peachy, ok djm@. + +20100128 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/01/26 02:15:20 + [mux.c] + -Wuninitialized and remove a // comment; from portable + (Id sync only) + - djm@cvs.openbsd.org 2010/01/27 13:26:17 + [mux.c] + fix bug introduced in mux rewrite: + + In a mux master, when a socket to a mux slave closes before its server + session (as may occur when the slave has been signalled), gracefully + close the server session rather than deleting its channel immediately. + A server may have more messages on that channel to send (e.g. an exit + message) that will fatal() the client if they are sent to a channel that + has been prematurely deleted. + + spotted by imorgan AT nas.nasa.gov + - djm@cvs.openbsd.org 2010/01/27 19:21:39 + [sftp.c] + add missing "p" flag to getopt optstring; + bz#1704 from imorgan AT nas.nasa.gov + +20100126 + - (djm) OpenBSD CVS Sync + - tedu@cvs.openbsd.org 2010/01/17 21:49:09 + [ssh-agent.1] + Correct and clarify ssh-add's password asking behavior. + Improved text dtucker and ok jmc + - dtucker@cvs.openbsd.org 2010/01/18 01:50:27 + [roaming_client.c] + s/long long unsigned/unsigned long long/, from tim via portable + (Id sync only, change already in portable) + - djm@cvs.openbsd.org 2010/01/26 01:28:35 + [channels.c channels.h clientloop.c clientloop.h mux.c nchan.c ssh.c] + rewrite ssh(1) multiplexing code to a more sensible protocol. + + The new multiplexing code uses channels for the listener and + accepted control sockets to make the mux master non-blocking, so + no stalls when processing messages from a slave. + + avoid use of fatal() in mux master protocol parsing so an errant slave + process cannot take down a running master. + + implement requesting of port-forwards over multiplexed sessions. Any + port forwards requested by the slave are added to those the master has + established. + + add support for stdio forwarding ("ssh -W host:port ...") in mux slaves. + + document master/slave mux protocol so that other tools can use it to + control a running ssh(1). Note: there are no guarantees that this + protocol won't be incompatibly changed (though it is versioned). + + feedback Salvador Fandino, dtucker@ + channel changes ok markus@ + +20100122 + - (tim) [configure.ac] Due to constraints in Windows Sockets in terms of + socket inheritance, reduce the default SO_RCVBUF/SO_SNDBUF buffer size + in Cygwin to 65535. Patch from Corinna Vinschen. + +20100117 + - (tim) [configure.ac] OpenServer 5 needs BROKEN_GETADDRINFO too. + - (tim) [configure.ac] On SVR5 systems, use the C99-conforming functions + snprintf() and vsnprintf() named _xsnprintf() and _xvsnprintf(). + +20100116 + - (dtucker) [openbsd-compat/pwcache.c] Pull in includes.h and thus defines.h + so we correctly detect whether or not we have a native user_from_uid. + - (dtucker) [openbsd-compat/openbsd-compat.h] Prototypes for user_from_uid + and group_from_gid. + - (dtucker) [openbsd-compat/openbsd-compat.h] Fix prototypes, spotted by + Tim. + - (dtucker) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2010/01/15 09:24:23 + [sftp-common.c] + unused + - (dtucker) [openbsd-compat/pwcache.c] Shrink ifdef area to prevent unused + variable warnings. + - (dtucker) [openbsd-compat/openbsd-compat.h] Typo. + - (tim) [regress/portnum.sh] Shell portability fix. + - (tim) [configure.ac] Define BROKEN_GETADDRINFO on SVR5 systems. The native + getaddrinfo() is too old and limited for addr_pton() in addrmatch.c. + - (tim) [roaming_client.c] Use of is not really portable so we + use "openbsd-compat/sys-queue.h". s/long long unsigned/unsigned long long/ + to keep USL compilers happy. + +20100115 + - (dtucker) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2010/01/13 12:48:34 + [sftp.1 sftp.c] + sftp.1: put ls -h in the right place + sftp.c: as above, plus add -p to get/put, and shorten their arg names + to keep the help usage nicely aligned + ok djm + - djm@cvs.openbsd.org 2010/01/13 23:47:26 + [auth.c] + when using ChrootDirectory, make sure we test for the existence of the + user's shell inside the chroot; bz #1679, patch from alex AT rtfs.hu; + ok dtucker + - dtucker@cvs.openbsd.org 2010/01/14 23:41:49 + [sftp-common.c] + use user_from{uid,gid} to lookup up ids since it keeps a small cache. + ok djm + - guenther@cvs.openbsd.org 2010/01/15 00:05:22 + [sftp.c] + Reset SIGTERM to SIG_DFL before executing ssh, so that even if sftp + inherited SIGTERM as ignored it will still be able to kill the ssh it + starts. + ok dtucker@ + - (dtucker) [openbsd-compat/pwcache.c] Pull in pwcache.c from OpenBSD (no + changes yet but there will be some to come). + - (dtucker) [configure.ac openbsd-compat/{Makefile.in,pwcache.c} Portability + for pwcache. Also, added caching of negative hits. + +20100114 + - (djm) [platform.h] Add missing prototype for + platform_krb5_get_principal_name + +20100113 + - (dtucker) [monitor_fdpass.c] Wrap poll.h include in ifdefs. + - (dtucker) [openbsd-compat/readpassphrase.c] Resync against OpenBSD's r1.18: + missing restore of SIGTTOU and some whitespace. + - (dtucker) [openbsd-compat/readpassphrase.c] Update to OpenBSD's r1.21. + - (dtucker) [openbsd-compat/readpassphrase.c] Update to OpenBSD's r1.22. + Fixes bz #1590, where sometimes you could not interrupt a connection while + ssh was prompting for a passphrase or password. + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2010/01/13 00:19:04 + [sshconnect.c auth.c] + Fix a couple of typos/mispellings in comments + - dtucker@cvs.openbsd.org 2010/01/13 01:10:56 + [key.c] + Ignore and log any Protocol 1 keys where the claimed size is not equal to + the actual size. Noted by Derek Martin, ok djm@ + - dtucker@cvs.openbsd.org 2010/01/13 01:20:20 + [canohost.c ssh-keysign.c sshconnect2.c] + Make HostBased authentication work with a ProxyCommand. bz #1569, patch + from imorgan at nas nasa gov, ok djm@ + - djm@cvs.openbsd.org 2010/01/13 01:40:16 + [sftp.c sftp-server.c sftp.1 sftp-common.c sftp-common.h] + support '-h' (human-readable units) for sftp's ls command, just like + ls(1); ok dtucker@ + - djm@cvs.openbsd.org 2010/01/13 03:48:13 + [servconf.c servconf.h sshd.c] + avoid run-time failures when specifying hostkeys via a relative + path by prepending the cwd in these cases; bz#1290; ok dtucker@ + - djm@cvs.openbsd.org 2010/01/13 04:10:50 + [sftp.c] + don't append a space after inserting a completion of a directory (i.e. + a path ending in '/') for a slightly better user experience; ok dtucker@ + - (dtucker) [sftp-common.c] Wrap include of util.h in an ifdef. + - (tim) [defines.h] openbsd-compat/readpassphrase.c now needs _NSIG. + feedback and ok dtucker@ + +20100112 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2010/01/11 01:39:46 + [ssh_config channels.c ssh.1 channels.h ssh.c] + Add a 'netcat mode' (ssh -W). This connects stdio on the client to a + single port forward on the server. This allows, for example, using ssh as + a ProxyCommand to route connections via intermediate servers. + bz #1618, man page help from jmc@, ok markus@ + - dtucker@cvs.openbsd.org 2010/01/11 04:46:45 + [authfile.c sshconnect2.c] + Do not prompt for a passphrase if we fail to open a keyfile, and log the + reason the open failed to debug. + bz #1693, found by tj AT castaglia org, ok djm@ + - djm@cvs.openbsd.org 2010/01/11 10:51:07 + [ssh-keygen.c] + when converting keys, truncate key comments at 72 chars as per RFC4716; + bz#1630 reported by tj AT castaglia.org; ok markus@ + - dtucker@cvs.openbsd.org 2010/01/12 00:16:47 + [authfile.c] + Fix bug introduced in r1.78 (incorrect brace location) that broke key auth. + Patch from joachim joachimschipper nl. + - djm@cvs.openbsd.org 2010/01/12 00:58:25 + [monitor_fdpass.c] + avoid spinning when fd passing on nonblocking sockets by calling poll() + in the EINTR/EAGAIN path, much like we do in atomicio; ok dtucker@ + - djm@cvs.openbsd.org 2010/01/12 00:59:29 + [roaming_common.c] + delete with extreme prejudice a debug() that fired with every keypress; + ok dtucker deraadt + - dtucker@cvs.openbsd.org 2010/01/12 01:31:05 + [session.c] + Do not allow logins if /etc/nologin exists but is not readable by the user + logging in. Noted by Jan.Pechanec at Sun, ok djm@ deraadt@ + - djm@cvs.openbsd.org 2010/01/12 01:36:08 + [buffer.h bufaux.c] + add a buffer_get_string_ptr_ret() that does the same as + buffer_get_string_ptr() but does not fatal() on error; ok dtucker@ + - dtucker@cvs.openbsd.org 2010/01/12 08:33:17 + [session.c] + Add explicit stat so we reliably detect nologin with bad perms. + ok djm markus + +20100110 + - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c] + Remove hacks add for RoutingDomain in preparation for its removal. + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2010/01/09 23:04:13 + [channels.c ssh.1 servconf.c sshd_config.5 sshd.c channels.h servconf.h + ssh-keyscan.1 ssh-keyscan.c readconf.c sshconnect.c misc.c ssh.c + readconf.h scp.1 sftp.1 ssh_config.5 misc.h] + Remove RoutingDomain from ssh since it's now not needed. It can be + replaced with "route exec" or "nc -V" as a proxycommand. "route exec" + also ensures that trafic such as DNS lookups stays withing the specified + routingdomain. For example (from reyk): + # route -T 2 exec /usr/sbin/sshd + or inherited from the parent process + $ route -T 2 exec sh + $ ssh 10.1.2.3 + ok deraadt@ markus@ stevesk@ reyk@ + - dtucker@cvs.openbsd.org 2010/01/10 03:51:17 + [servconf.c] + Add ChrootDirectory to sshd.c test-mode output + - dtucker@cvs.openbsd.org 2010/01/10 07:15:56 + [auth.c] + Output a debug if we can't open an existing keyfile. bz#1694, ok djm@ + +20100109 + - (dtucker) Wrap use of IPPROTO_IPV6 in an ifdef for platforms that don't + have it. + - (dtucker) [defines.h] define PRIu64 for platforms that don't have it. + - (dtucker) [roaming_client.c] Wrap inttypes.h in an ifdef. + - (dtucker) [loginrec.c] Use the SUSv3 specified name for the user name + when using utmpx. Patch from Ed Schouten. + - (dtucker) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/01/09 00:20:26 + [sftp-server.c sftp-server.8] + add a 'read-only' mode to sftp-server(8) that disables open in write mode + and all other fs-modifying protocol methods. bz#430 ok dtucker@ + - djm@cvs.openbsd.org 2010/01/09 00:57:10 + [PROTOCOL] + tweak language + - jmc@cvs.openbsd.org 2010/01/09 03:36:00 + [sftp-server.8] + bad place to forget a comma... + - djm@cvs.openbsd.org 2010/01/09 05:04:24 + [mux.c sshpty.h clientloop.c sshtty.c] + quell tc[gs]etattr warnings when forcing a tty (ssh -tt), since we + usually don't actually have a tty to read/set; bz#1686 ok dtucker@ + - dtucker@cvs.openbsd.org 2010/01/09 05:17:00 + [roaming_client.c] + Remove a PRIu64 format string that snuck in with roaming. ok djm@ + - dtucker@cvs.openbsd.org 2010/01/09 11:13:02 + [sftp.c] + Prevent sftp from derefing a null pointer when given a "-" without a + command. Also, allow whitespace to follow a "-". bz#1691, path from + Colin Watson via Debian. ok djm@ deraadt@ + - dtucker@cvs.openbsd.org 2010/01/09 11:17:56 + [sshd.c] + Afer sshd receives a SIGHUP, ignore subsequent HUPs while sshd re-execs + itself. Prevents two HUPs in quick succession from resulting in sshd + dying. bz#1692, patch from Colin Watson via Ubuntu. + - (dtucker) [defines.h] Remove now-undeeded PRIu64 define. + +20100108 + - (dtucker) OpenBSD CVS Sync + - andreas@cvs.openbsd.org 2009/10/24 11:11:58 + [roaming.h] + Declarations needed for upcoming changes. + ok markus@ + - andreas@cvs.openbsd.org 2009/10/24 11:13:54 + [sshconnect2.c kex.h kex.c] + Let the client detect if the server supports roaming by looking + for the resume@appgate.com kex algorithm. + ok markus@ + - andreas@cvs.openbsd.org 2009/10/24 11:15:29 + [clientloop.c] + client_loop() must detect if the session has been suspended and resumed, + and take appropriate action in that case. + From Martin Forssen, maf at appgate dot com + - andreas@cvs.openbsd.org 2009/10/24 11:19:17 + [ssh2.h] + Define the KEX messages used when resuming a suspended connection. + ok markus@ + - andreas@cvs.openbsd.org 2009/10/24 11:22:37 + [roaming_common.c] + Do the actual suspend/resume in the client. This won't be useful until + the server side supports roaming. + Most code from Martin Forssen, maf at appgate dot com. Some changes by + me and markus@ + ok markus@ + - andreas@cvs.openbsd.org 2009/10/24 11:23:42 + [ssh.c] + Request roaming to be enabled if UseRoaming is true and the server + supports it. + ok markus@ + - reyk@cvs.openbsd.org 2009/10/28 16:38:18 + [ssh_config.5 sshd.c misc.h ssh-keyscan.1 readconf.h sshconnect.c + channels.c channels.h servconf.h servconf.c ssh.1 ssh-keyscan.c scp.1 + sftp.1 sshd_config.5 readconf.c ssh.c misc.c] + Allow to set the rdomain in ssh/sftp/scp/sshd and ssh-keyscan. + ok markus@ + - jmc@cvs.openbsd.org 2009/10/28 21:45:08 + [sshd_config.5 sftp.1] + tweak previous; + - djm@cvs.openbsd.org 2009/11/10 02:56:22 + [ssh_config.5] + explain the constraints on LocalCommand some more so people don't + try to abuse it. + - djm@cvs.openbsd.org 2009/11/10 02:58:56 + [sshd_config.5] + clarify that StrictModes does not apply to ChrootDirectory. Permissions + and ownership are always checked when chrooting. bz#1532 + - dtucker@cvs.openbsd.org 2009/11/10 04:30:45 + [sshconnect2.c channels.c sshconnect.c] + Set close-on-exec on various descriptors so they don't get leaked to + child processes. bz #1643, patch from jchadima at redhat, ok deraadt. + - markus@cvs.openbsd.org 2009/11/11 21:37:03 + [channels.c channels.h] + fix race condition in x11/agent channel allocation: don't read after + the end of the select read/write fdset and make sure a reused FD + is not touched before the pre-handlers are called. + with and ok djm@ + - djm@cvs.openbsd.org 2009/11/17 05:31:44 + [clientloop.c] + fix incorrect exit status when multiplexing and channel ID 0 is recycled + bz#1570 reported by peter.oliver AT eon-is.co.uk; ok dtucker + - djm@cvs.openbsd.org 2009/11/19 23:39:50 + [session.c] + bz#1606: error when an attempt is made to connect to a server + with ForceCommand=internal-sftp with a shell session (i.e. not a + subsystem session). Avoids stuck client when attempting to ssh to such a + service. ok dtucker@ + - dtucker@cvs.openbsd.org 2009/11/20 00:15:41 + [session.c] + Warn but do not fail if stat()ing the subsystem binary fails. This helps + with chrootdirectory+forcecommand=sftp-server and restricted shells. + bz #1599, ok djm. + - djm@cvs.openbsd.org 2009/11/20 00:54:01 + [sftp.c] + bz#1588 change "Connecting to host..." message to "Connected to host." + and delay it until after the sftp protocol connection has been established. + Avoids confusing sequence of messages when the underlying ssh connection + experiences problems. ok dtucker@ + - dtucker@cvs.openbsd.org 2009/11/20 00:59:36 + [sshconnect2.c] + Use the HostKeyAlias when prompting for passwords. bz#1039, ok djm@ + - djm@cvs.openbsd.org 2009/11/20 03:24:07 + [misc.c] + correct off-by-one in percent_expand(): we would fatal() when trying + to expand EXPAND_MAX_KEYS, allowing only EXPAND_MAX_KEYS-1 to actually + work. Note that nothing in OpenSSH actually uses close to this limit at + present. bz#1607 from Jan.Pechanec AT Sun.COM + - halex@cvs.openbsd.org 2009/11/22 13:18:00 + [sftp.c] + make passing of zero-length arguments to ssh safe by + passing "-" "" rather than "-" + ok dtucker@, guenther@, djm@ + - dtucker@cvs.openbsd.org 2009/12/06 23:41:15 + [sshconnect2.c] + zap unused variable and strlen; from Steve McClellan, ok djm + - djm@cvs.openbsd.org 2009/12/06 23:53:45 + [roaming_common.c] + use socklen_t for getsockopt optlen parameter; reported by + Steve.McClellan AT radisys.com, ok dtucker@ + - dtucker@cvs.openbsd.org 2009/12/06 23:53:54 + [sftp.c] + fix potential divide-by-zero in sftp's "df" output when talking to a server + that reports zero files on the filesystem (Unix filesystems always have at + least the root inode). From Steve McClellan at radisys, ok djm@ + - markus@cvs.openbsd.org 2009/12/11 18:16:33 + [key.c] + switch from 35 to the more common value of RSA_F4 == (2**16)+1 == 65537 + for the RSA public exponent; discussed with provos; ok djm@ + - guenther@cvs.openbsd.org 2009/12/20 07:28:36 + [ssh.c sftp.c scp.c] + When passing user-controlled options with arguments to other programs, + pass the option and option argument as separate argv entries and + not smashed into one (e.g., as -l foo and not -lfoo). Also, always + pass a "--" argument to stop option parsing, so that a positional + argument that starts with a '-' isn't treated as an option. This + fixes some error cases as well as the handling of hostnames and + filenames that start with a '-'. + Based on a diff by halex@ + ok halex@ djm@ deraadt@ + - djm@cvs.openbsd.org 2009/12/20 23:20:40 + [PROTOCOL] + fix an incorrect magic number and typo in PROTOCOL; bz#1688 + report and fix from ueno AT unixuser.org + - stevesk@cvs.openbsd.org 2009/12/25 19:40:21 + [readconf.c servconf.c misc.h ssh-keyscan.c misc.c] + validate routing domain is in range 0-RT_TABLEID_MAX. + 'Looks right' deraadt@ + - stevesk@cvs.openbsd.org 2009/12/29 16:38:41 + [sshd_config.5 readconf.c ssh_config.5 scp.1 servconf.c sftp.1 ssh.1] + Rename RDomain config option to RoutingDomain to be more clear and + consistent with other options. + NOTE: if you currently use RDomain in the ssh client or server config, + or ssh/sshd -o, you must update to use RoutingDomain. + ok markus@ djm@ + - jmc@cvs.openbsd.org 2009/12/29 18:03:32 + [sshd_config.5 ssh_config.5] + sort previous; + - dtucker@cvs.openbsd.org 2010/01/04 01:45:30 + [sshconnect2.c] + Don't escape backslashes in the SSH2 banner. bz#1533, patch from + Michal Gorny via Gentoo. + - djm@cvs.openbsd.org 2010/01/04 02:03:57 + [sftp.c] + Implement tab-completion of commands, local and remote filenames for sftp. + Hacked on and off for some time by myself, mouring, Carlos Silva (via 2009 + Google Summer of Code) and polished to a fine sheen by myself again. + It should deal more-or-less correctly with the ikky corner-cases presented + by quoted filenames, but the UI could still be slightly improved. + In particular, it is quite slow for remote completion on large directories. + bz#200; ok markus@ + - djm@cvs.openbsd.org 2010/01/04 02:25:15 + [sftp-server.c] + bz#1566 don't unnecessarily dup() in and out fds for sftp-server; + ok markus@ + - dtucker@cvs.openbsd.org 2010/01/08 21:50:49 + [sftp.c] + Fix two warnings: possibly used unitialized and use a nul byte instead of + NULL pointer. ok djm@ + - (dtucker) [Makefile.in added roaming_client.c roaming_serv.c] Import new + files for roaming and add to Makefile. + - (dtucker) [Makefile.in] .c files do not belong in the OBJ lines. + - (dtucker) [sftp.c] ifdef out the sftp completion bits for platforms that + don't have libedit. + - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c] Make + RoutingDomain an unsupported option on platforms that don't have it. + - (dtucker) [sftp.c] Expand ifdef for libedit to cover complete_is_remote + too. + - (dtucker) [misc.c] Move the routingdomain ifdef to allow the socket to + be created. + - (dtucker] [misc.c] Shrink the area covered by USE_ROUTINGDOMAIN more + to eliminate an unused variable warning. + - (dtucker) [roaming_serv.c] Include includes.h for u_intXX_t types. + +20091226 + - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1 + Gzip all man pages. Patch from Corinna Vinschen. + +20091221 + - (dtucker) [auth-krb5.c platform.{c,h} openbsd-compat/port-aix.{c,h}] + Bug #1583: Use system's kerberos principal name on AIX if it's available. + Based on a patch from and tested by Miguel Sanders + +20091208 + - (dtucker) Bug #1470: Disable OOM-killing of the listening sshd on Linux, + based on a patch from Vaclav Ovsik and Colin Watson. ok djm. + +20091207 + - (dtucker) Bug #1160: use pkg-config for opensc config if it's available. + Tested by Martin Paljak. + - (dtucker) Bug #1677: add conditionals around the source for ssh-askpass. + +20091121 + - (tim) [opensshd.init.in] If PidFile is set in sshd_config, use it. + Bug 1628. OK dtucker@ + +20091120 + - (djm) [ssh-rand-helper.c] Print error and usage() when passed command- + line arguments as none are supported. Exit when passed unrecognised + commandline flags. bz#1568 from gson AT araneus.fi + +20091118 + - (djm) [channels.c misc.c misc.h sshd.c] add missing setsockopt() to + set IPV6_V6ONLY for local forwarding with GatwayPorts=yes. Unify + setting IPV6_V6ONLY behind a new function misc.c:sock_set_v6only() + bz#1648, report and fix from jan.kratochvil AT redhat.com + - (djm) [contrib/gnome-ssh-askpass2.c] Make askpass dialog desktop-modal. + bz#1645, patch from jchadima AT redhat.com + +20091107 + - (dtucker) [authfile.c] Fall back to 3DES for the encryption of private + keys when built with OpenSSL versions that don't do AES. + +20091105 + - (dtucker) [authfile.c] Add OpenSSL compat header so this still builds with + older versions of OpenSSL. + +20091024 + - (dtucker) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2009/10/11 23:03:15 + [hostfile.c] + mention the host name that we are looking for in check_host_in_hostfile() + - sobrado@cvs.openbsd.org 2009/10/17 12:10:39 + [sftp-server.c] + sort flags. + - sobrado@cvs.openbsd.org 2009/10/22 12:35:53 + [ssh.1 ssh-agent.1 ssh-add.1] + use the UNIX-related macros (.At and .Ux) where appropriate. + ok jmc@ + - sobrado@cvs.openbsd.org 2009/10/22 15:02:12 + [ssh-agent.1 ssh-add.1 ssh.1] + write UNIX-domain in a more consistent way; while here, replace a + few remaining ".Tn UNIX" macros with ".Ux" ones. + pointed out by ratchov@, thanks! + ok jmc@ + - djm@cvs.openbsd.org 2009/10/22 22:26:13 + [authfile.c] + switch from 3DES to AES-128 for encryption of passphrase-protected + SSH protocol 2 private keys; ok several + - djm@cvs.openbsd.org 2009/10/23 01:57:11 + [sshconnect2.c] + disallow a hostile server from checking jpake auth by sending an + out-of-sequence success message. (doesn't affect code enabled by default) + - dtucker@cvs.openbsd.org 2009/10/24 00:48:34 + [ssh-keygen.1] + ssh-keygen now uses AES-128 for private keys + - (dtucker) [mdoc2man.awk] Teach it to understand the .Ux macro. + - (dtucker) [session.c openbsd-compat/port-linux.{c,h}] Bug #1637: if selinux + is enabled set the security context to "sftpd_t" before running the + internal sftp server Based on a patch from jchadima at redhat. + +20091011 + - (dtucker) [configure.ac sftp-client.c] Remove the gyrations required for + dirent d_type and DTTOIF as we've switched OpenBSD to the more portable + lstat. + - (dtucker) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2009/10/08 14:03:41 + [sshd_config readconf.c ssh_config.5 servconf.c sshd_config.5] + disable protocol 1 by default (after a transition period of about 10 years) + ok deraadt + - jmc@cvs.openbsd.org 2009/10/08 20:42:12 + [sshd_config.5 ssh_config.5 sshd.8 ssh.1] + some tweaks now that protocol 1 is not offered by default; ok markus + - dtucker@cvs.openbsd.org 2009/10/11 10:41:26 + [sftp-client.c] + d_type isn't portable so use lstat to get dirent modes. Suggested by and + "looks sane" deraadt@ + - markus@cvs.openbsd.org 2009/10/08 18:04:27 + [regress/test-exec.sh] + re-enable protocol v1 for the tests. + +20091007 + - (dtucker) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2009/08/12 00:13:00 + [sftp.c sftp.1] + support most of scp(1)'s commandline arguments in sftp(1), as a first + step towards making sftp(1) a drop-in replacement for scp(1). + One conflicting option (-P) has not been changed, pending further + discussion. + Patch from carlosvsilvapt@gmail.com as part of his work in the + Google Summer of Code + - jmc@cvs.openbsd.org 2009/08/12 06:31:42 + [sftp.1] + sort options; + - djm@cvs.openbsd.org 2009/08/13 01:11:19 + [sftp.1 sftp.c] + Swizzle options: "-P sftp_server_path" moves to "-D sftp_server_path", + add "-P port" to match scp(1). Fortunately, the -P option is only really + used by our regression scripts. + part of larger patch from carlosvsilvapt@gmail.com for his Google Summer + of Code work; ok deraadt markus + - jmc@cvs.openbsd.org 2009/08/13 13:39:54 + [sftp.1 sftp.c] + sync synopsis and usage(); + - djm@cvs.openbsd.org 2009/08/14 18:17:49 + [sftp-client.c] + make the "get_handle: ..." error messages vaguely useful by allowing + callers to specify their own error message strings. + - fgsch@cvs.openbsd.org 2009/08/15 18:56:34 + [auth.h] + remove unused define. markus@ ok. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 09:59:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE38A106566B; Wed, 28 Apr 2010 09:59: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 AC1FE8FC18; Wed, 28 Apr 2010 09:59:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3S9xSPt093520; Wed, 28 Apr 2010 09:59:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3S9xShO093517; Wed, 28 Apr 2010 09:59:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004280959.o3S9xShO093517@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 28 Apr 2010 09:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207316 - stable/8/sys/compat/freebsd32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 09:59:28 -0000 Author: kib Date: Wed Apr 28 09:59:28 2010 New Revision: 207316 URL: http://svn.freebsd.org/changeset/base/207316 Log: MFC r207007: Extract the code to copy-out struct rusage32 from struct rusage into the new function. Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/compat/freebsd32/freebsd32_util.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Apr 28 09:53:54 2010 (r207315) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Apr 28 09:59:28 2010 (r207316) @@ -129,6 +129,28 @@ static int freebsd32_kevent_copyin(void #define RETVAL_LO 0 #endif +void +freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32) +{ + + TV_CP(*s, *s32, ru_utime); + TV_CP(*s, *s32, ru_stime); + CP(*s, *s32, ru_maxrss); + CP(*s, *s32, ru_ixrss); + CP(*s, *s32, ru_idrss); + CP(*s, *s32, ru_isrss); + CP(*s, *s32, ru_minflt); + CP(*s, *s32, ru_majflt); + CP(*s, *s32, ru_nswap); + CP(*s, *s32, ru_inblock); + CP(*s, *s32, ru_oublock); + CP(*s, *s32, ru_msgsnd); + CP(*s, *s32, ru_msgrcv); + CP(*s, *s32, ru_nsignals); + CP(*s, *s32, ru_nvcsw); + CP(*s, *s32, ru_nivcsw); +} + int freebsd32_wait4(struct thread *td, struct freebsd32_wait4_args *uap) { @@ -146,22 +168,7 @@ freebsd32_wait4(struct thread *td, struc if (uap->status != NULL) error = copyout(&status, uap->status, sizeof(status)); if (uap->rusage != NULL && error == 0) { - TV_CP(ru, ru32, ru_utime); - TV_CP(ru, ru32, ru_stime); - CP(ru, ru32, ru_maxrss); - CP(ru, ru32, ru_ixrss); - CP(ru, ru32, ru_idrss); - CP(ru, ru32, ru_isrss); - CP(ru, ru32, ru_minflt); - CP(ru, ru32, ru_majflt); - CP(ru, ru32, ru_nswap); - CP(ru, ru32, ru_inblock); - CP(ru, ru32, ru_oublock); - CP(ru, ru32, ru_msgsnd); - CP(ru, ru32, ru_msgrcv); - CP(ru, ru32, ru_nsignals); - CP(ru, ru32, ru_nvcsw); - CP(ru, ru32, ru_nivcsw); + freebsd32_rusage_out(&ru, &ru32); error = copyout(&ru32, uap->rusage, sizeof(ru32)); } return (error); @@ -755,22 +762,7 @@ freebsd32_getrusage(struct thread *td, s if (error) return (error); if (uap->rusage != NULL) { - TV_CP(s, s32, ru_utime); - TV_CP(s, s32, ru_stime); - CP(s, s32, ru_maxrss); - CP(s, s32, ru_ixrss); - CP(s, s32, ru_idrss); - CP(s, s32, ru_isrss); - CP(s, s32, ru_minflt); - CP(s, s32, ru_majflt); - CP(s, s32, ru_nswap); - CP(s, s32, ru_inblock); - CP(s, s32, ru_oublock); - CP(s, s32, ru_msgsnd); - CP(s, s32, ru_msgrcv); - CP(s, s32, ru_nsignals); - CP(s, s32, ru_nvcsw); - CP(s, s32, ru_nivcsw); + freebsd32_rusage_out(&s, &s32); error = copyout(&s32, uap->rusage, sizeof(s32)); } return (error); Modified: stable/8/sys/compat/freebsd32/freebsd32_util.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_util.h Wed Apr 28 09:53:54 2010 (r207315) +++ stable/8/sys/compat/freebsd32/freebsd32_util.h Wed Apr 28 09:59:28 2010 (r207316) @@ -94,9 +94,12 @@ int syscall32_module_handler(struct m int syscall32_helper_register(struct syscall_helper_data *sd); int syscall32_helper_unregister(struct syscall_helper_data *sd); -register_t *freebsd32_copyout_strings(struct image_params *imgp); struct iovec32; +struct rusage32; +register_t *freebsd32_copyout_strings(struct image_params *imgp); int freebsd32_copyiniov(struct iovec32 *iovp, u_int iovcnt, struct iovec **iov, int error); +void freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32); + #endif /* !_COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 10:03:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D4ED106564A; Wed, 28 Apr 2010 10:03:55 +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 1A64E8FC20; Wed, 28 Apr 2010 10:03:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3SA3sbw094587; Wed, 28 Apr 2010 10:03:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SA3sLQ094583; Wed, 28 Apr 2010 10:03:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004281003.o3SA3sLQ094583@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 28 Apr 2010 10:03: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: r207317 - in stable/8/sys: compat/freebsd32 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 10:03:55 -0000 Author: kib Date: Wed Apr 28 10:03:54 2010 New Revision: 207317 URL: http://svn.freebsd.org/changeset/base/207317 Log: MFC r207008: Provide compat32 shims for kinfo_proc sysctl. MFC r207016: Fix typo. Modified: stable/8/sys/compat/freebsd32/freebsd32.h stable/8/sys/kern/kern_proc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32.h Wed Apr 28 09:59:28 2010 (r207316) +++ stable/8/sys/compat/freebsd32/freebsd32.h Wed Apr 28 10:03:54 2010 (r207317) @@ -31,6 +31,7 @@ #include #include +#include #define PTRIN(v) (void *)(uintptr_t) (v) #define PTROUT(v) (u_int32_t)(uintptr_t) (v) @@ -229,4 +230,85 @@ struct mq_attr32 { int __reserved[4]; }; +struct kinfo_proc32 { + int ki_structsize; + int ki_layout; + uint32_t ki_args; + uint32_t ki_paddr; + uint32_t ki_addr; + uint32_t ki_tracep; + uint32_t ki_textvp; + uint32_t ki_fd; + uint32_t ki_vmspace; + uint32_t ki_wchan; + pid_t ki_pid; + pid_t ki_ppid; + pid_t ki_pgid; + pid_t ki_tpgid; + pid_t ki_sid; + pid_t ki_tsid; + short ki_jobc; + short ki_spare_short1; + dev_t ki_tdev; + sigset_t ki_siglist; + sigset_t ki_sigmask; + sigset_t ki_sigignore; + sigset_t ki_sigcatch; + uid_t ki_uid; + uid_t ki_ruid; + uid_t ki_svuid; + gid_t ki_rgid; + gid_t ki_svgid; + short ki_ngroups; + short ki_spare_short2; + gid_t ki_groups[KI_NGROUPS]; + uint32_t ki_size; + int32_t ki_rssize; + int32_t ki_swrss; + int32_t ki_tsize; + int32_t ki_dsize; + int32_t ki_ssize; + u_short ki_xstat; + u_short ki_acflag; + fixpt_t ki_pctcpu; + u_int ki_estcpu; + u_int ki_slptime; + u_int ki_swtime; + int ki_spareint1; + u_int64_t ki_runtime; + struct timeval32 ki_start; + struct timeval32 ki_childtime; + int ki_flag; + int ki_kiflag; + int ki_traceflag; + char ki_stat; + signed char ki_nice; + char ki_lock; + char ki_rqindex; + u_char ki_oncpu; + u_char ki_lastcpu; + char ki_ocomm[OCOMMLEN+1]; + char ki_wmesg[WMESGLEN+1]; + char ki_login[LOGNAMELEN+1]; + char ki_lockname[LOCKNAMELEN+1]; + char ki_comm[COMMLEN+1]; + char ki_emul[KI_EMULNAMELEN+1]; + char ki_sparestrings[68]; + int ki_spareints[KI_NSPARE_INT]; + u_int ki_cr_flags; + int ki_jid; + int ki_numthreads; + lwpid_t ki_tid; + struct priority ki_pri; + struct rusage32 ki_rusage; + struct rusage32 ki_rusage_ch; + uint32_t ki_pcb; + uint32_t ki_kstack; + uint32_t ki_udata; + uint32_t ki_spareptrs[KI_NSPARE_PTR]; /* spare room for growth */ + int ki_sparelongs[KI_NSPARE_LONG]; + int ki_sflag; + int ki_tdflags; +}; + #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */ Modified: stable/8/sys/kern/kern_proc.c ============================================================================== --- stable/8/sys/kern/kern_proc.c Wed Apr 28 09:59:28 2010 (r207316) +++ stable/8/sys/kern/kern_proc.c Wed Apr 28 10:03:54 2010 (r207317) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -79,6 +80,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef COMPAT_FREEBSD32 +#include +#include +#endif + SDT_PROVIDER_DEFINE(proc); SDT_PROBE_DEFINE(proc, kernel, ctor, entry); SDT_PROBE_ARGTYPE(proc, kernel, ctor, entry, 0, "struct proc *"); @@ -968,6 +974,128 @@ zpfind(pid_t pid) #define KERN_PROC_ZOMBMASK 0x3 #define KERN_PROC_NOTHREADS 0x4 +#ifdef COMPAT_FREEBSD32 + +/* + * This function is typically used to copy out the kernel address, so + * it can be replaced by assignment of zero. + */ +static inline uint32_t +ptr32_trim(void *ptr) +{ + uintptr_t uptr; + + uptr = (uintptr_t)ptr; + return ((uptr > UINT_MAX) ? 0 : uptr); +} + +#define PTRTRIM_CP(src,dst,fld) \ + do { (dst).fld = ptr32_trim((src).fld); } while (0) + +static void +freebsd32_kinfo_proc_out(const struct kinfo_proc *ki, struct kinfo_proc32 *ki32) +{ + int i; + + bzero(ki32, sizeof(struct kinfo_proc32)); + ki32->ki_structsize = sizeof(struct kinfo_proc32); + CP(*ki, *ki32, ki_layout); + PTRTRIM_CP(*ki, *ki32, ki_args); + PTRTRIM_CP(*ki, *ki32, ki_paddr); + PTRTRIM_CP(*ki, *ki32, ki_addr); + PTRTRIM_CP(*ki, *ki32, ki_tracep); + PTRTRIM_CP(*ki, *ki32, ki_textvp); + PTRTRIM_CP(*ki, *ki32, ki_fd); + PTRTRIM_CP(*ki, *ki32, ki_vmspace); + PTRTRIM_CP(*ki, *ki32, ki_wchan); + CP(*ki, *ki32, ki_pid); + CP(*ki, *ki32, ki_ppid); + CP(*ki, *ki32, ki_pgid); + CP(*ki, *ki32, ki_tpgid); + CP(*ki, *ki32, ki_sid); + CP(*ki, *ki32, ki_tsid); + CP(*ki, *ki32, ki_jobc); + CP(*ki, *ki32, ki_tdev); + CP(*ki, *ki32, ki_siglist); + CP(*ki, *ki32, ki_sigmask); + CP(*ki, *ki32, ki_sigignore); + CP(*ki, *ki32, ki_sigcatch); + CP(*ki, *ki32, ki_uid); + CP(*ki, *ki32, ki_ruid); + CP(*ki, *ki32, ki_svuid); + CP(*ki, *ki32, ki_rgid); + CP(*ki, *ki32, ki_svgid); + CP(*ki, *ki32, ki_ngroups); + for (i = 0; i < KI_NGROUPS; i++) + CP(*ki, *ki32, ki_groups[i]); + CP(*ki, *ki32, ki_size); + CP(*ki, *ki32, ki_rssize); + CP(*ki, *ki32, ki_swrss); + CP(*ki, *ki32, ki_tsize); + CP(*ki, *ki32, ki_dsize); + CP(*ki, *ki32, ki_ssize); + CP(*ki, *ki32, ki_xstat); + CP(*ki, *ki32, ki_acflag); + CP(*ki, *ki32, ki_pctcpu); + CP(*ki, *ki32, ki_estcpu); + CP(*ki, *ki32, ki_slptime); + CP(*ki, *ki32, ki_swtime); + CP(*ki, *ki32, ki_runtime); + TV_CP(*ki, *ki32, ki_start); + TV_CP(*ki, *ki32, ki_childtime); + CP(*ki, *ki32, ki_flag); + CP(*ki, *ki32, ki_kiflag); + CP(*ki, *ki32, ki_traceflag); + CP(*ki, *ki32, ki_stat); + CP(*ki, *ki32, ki_nice); + CP(*ki, *ki32, ki_lock); + CP(*ki, *ki32, ki_rqindex); + CP(*ki, *ki32, ki_oncpu); + CP(*ki, *ki32, ki_lastcpu); + bcopy(ki->ki_ocomm, ki32->ki_ocomm, OCOMMLEN + 1); + bcopy(ki->ki_wmesg, ki32->ki_wmesg, WMESGLEN + 1); + bcopy(ki->ki_login, ki32->ki_login, LOGNAMELEN + 1); + bcopy(ki->ki_lockname, ki32->ki_lockname, LOCKNAMELEN + 1); + bcopy(ki->ki_comm, ki32->ki_comm, COMMLEN + 1); + bcopy(ki->ki_emul, ki32->ki_emul, KI_EMULNAMELEN + 1); + CP(*ki, *ki32, ki_cr_flags); + CP(*ki, *ki32, ki_jid); + CP(*ki, *ki32, ki_numthreads); + CP(*ki, *ki32, ki_tid); + CP(*ki, *ki32, ki_pri); + freebsd32_rusage_out(&ki->ki_rusage, &ki32->ki_rusage); + freebsd32_rusage_out(&ki->ki_rusage_ch, &ki32->ki_rusage_ch); + PTRTRIM_CP(*ki, *ki32, ki_pcb); + PTRTRIM_CP(*ki, *ki32, ki_kstack); + PTRTRIM_CP(*ki, *ki32, ki_udata); + CP(*ki, *ki32, ki_sflag); + CP(*ki, *ki32, ki_tdflags); +} + +static int +sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req) +{ + struct kinfo_proc32 ki32; + int error; + + if (req->flags & SCTL_MASK32) { + freebsd32_kinfo_proc_out(ki, &ki32); + error = SYSCTL_OUT(req, (caddr_t)&ki32, + sizeof(struct kinfo_proc32)); + } else + error = SYSCTL_OUT(req, (caddr_t)ki, + sizeof(struct kinfo_proc)); + return (error); +} +#else +static int +sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req) +{ + + return (SYSCTL_OUT(req, (caddr_t)ki, sizeof(struct kinfo_proc))); +} +#endif + /* * Must be called with the process locked and will return with it unlocked. */ @@ -985,13 +1113,11 @@ sysctl_out_proc(struct proc *p, struct s fill_kinfo_proc(p, &kinfo_proc); if (flags & KERN_PROC_NOTHREADS) - error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, - sizeof(kinfo_proc)); + error = sysctl_out_proc_copyout(&kinfo_proc, req); else { FOREACH_THREAD_IN_PROC(p, td) { fill_kinfo_thread(td, &kinfo_proc, 1); - error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, - sizeof(kinfo_proc)); + error = sysctl_out_proc_copyout(&kinfo_proc, req); if (error) break; } From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 10:33:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6C5C106564A; Wed, 28 Apr 2010 10:33:41 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95E258FC08; Wed, 28 Apr 2010 10:33: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 o3SAXfW3001265; Wed, 28 Apr 2010 10:33:41 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SAXf6r001263; Wed, 28 Apr 2010 10:33:41 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <201004281033.o3SAXf6r001263@svn.freebsd.org> From: Robert Noland Date: Wed, 28 Apr 2010 10:33: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: r207318 - head/sys/dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 10:33:41 -0000 Author: rnoland Date: Wed Apr 28 10:33:41 2010 New Revision: 207318 URL: http://svn.freebsd.org/changeset/base/207318 Log: fx->lock is used as an index, correct test case. MFC after: 1 week Modified: head/sys/dev/drm/via_video.c Modified: head/sys/dev/drm/via_video.c ============================================================================== --- head/sys/dev/drm/via_video.c Wed Apr 28 10:03:54 2010 (r207317) +++ head/sys/dev/drm/via_video.c Wed Apr 28 10:33:41 2010 (r207318) @@ -78,7 +78,7 @@ int via_decoder_futex(struct drm_device DRM_DEBUG("\n"); - if (fx->lock > VIA_NR_XVMC_LOCKS) + if (fx->lock >= VIA_NR_XVMC_LOCKS) return -EFAULT; lock = (volatile int *)XVMCLOCKPTR(sAPriv, fx->lock); From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 10:36:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0CB3106566C; Wed, 28 Apr 2010 10:36:34 +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 399F68FC1A; Wed, 28 Apr 2010 10:36: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 o3SAaYwc001953; Wed, 28 Apr 2010 10:36:34 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SAaXTB001927; Wed, 28 Apr 2010 10:36:33 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201004281036.o3SAaXTB001927@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 28 Apr 2010 10:36: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: r207319 - in head/crypto/openssh: . openbsd-compat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 10:36:34 -0000 Author: des Date: Wed Apr 28 10:36:33 2010 New Revision: 207319 URL: http://svn.freebsd.org/changeset/base/207319 Log: Upgrade to OpenSSH 5.5p1. Modified: head/crypto/openssh/ChangeLog head/crypto/openssh/README head/crypto/openssh/auth-options.c head/crypto/openssh/auth2-pubkey.c head/crypto/openssh/channels.c head/crypto/openssh/clientloop.c head/crypto/openssh/config.h head/crypto/openssh/config.h.in head/crypto/openssh/defines.h head/crypto/openssh/key.c head/crypto/openssh/key.h head/crypto/openssh/loginrec.c head/crypto/openssh/logintest.c head/crypto/openssh/openbsd-compat/bsd-arc4random.c head/crypto/openssh/servconf.c head/crypto/openssh/session.c head/crypto/openssh/ssh-keygen.1 head/crypto/openssh/ssh-keygen.c head/crypto/openssh/ssh-pkcs11-helper.c head/crypto/openssh/ssh.1 head/crypto/openssh/ssh_config head/crypto/openssh/ssh_config.5 head/crypto/openssh/sshd_config head/crypto/openssh/sshd_config.5 head/crypto/openssh/version.h Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/ChangeLog ============================================================================== --- head/crypto/openssh/ChangeLog Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/ChangeLog Wed Apr 28 10:36:33 2010 (r207319) @@ -1,4 +1,120 @@ -20100307 +20100410 + - (dtucker) [configure.ac] Put the check for the existence of getaddrinfo + back so we disable the IPv6 tests if we don't have it. + +20100409 + - (dtucker) [contrib/cygwin/Makefile] Don't overwrite files with the wrong + ones. Based on a patch from Roumen Petrov. + - (dtucker) [configure.ac] Bug #1744: use pkg-config for libedit flags if we + have it and the path is not provided to --with-libedit. Based on a patch + from Iain Morgan. + - (dtucker) [configure.ac defines.h loginrec.c logintest.c] Bug #1732: enable + utmpx support on FreeBSD where possible. Patch from Ed Schouten, ok djm@ + +20100326 + - (djm) [openbsd-compat/bsd-arc4random.c] Fix preprocessor detection + for arc4random_buf() and arc4random_uniform(); from Josh Gilkerson + - (dtucker) [configure.ac] Bug #1741: Add section for Haiku, patch originally + by Ingo Weinhold via Scott McCreary, ok djm@ + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/03/25 23:38:28 + [servconf.c] + from portable: getcwd(NULL, 0) doesn't work on all platforms, so + use a stack buffer; ok dtucker@ + - djm@cvs.openbsd.org 2010/03/26 00:26:58 + [ssh.1] + mention that -S none disables connection sharing; from Colin Watson + - (djm) [session.c] Allow ChrootDirectory to work on SELinux platforms - + set up SELinux execution context before chroot() call. From Russell + Coker via Colin watson; bz#1726 ok dtucker@ + - (djm) [channels.c] Check for EPFNOSUPPORT as a socket() errno; bz#1721 + ok dtucker@ + - (dtucker) Bug #1725: explicitly link libX11 into gnome-ssh-askpass2 using + pkg-config, patch from Colin Watson. Needed for newer linkers (ie gold). + - (djm) [contrib/ssh-copy-id] Don't blow up when the agent has no keys; + bz#1723 patch from Adeodato Simóvia Colin Watson; ok dtucker@ + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2010/03/26 01:06:13 + [ssh_config.5] + Reformat default value of PreferredAuthentications entry (current + formatting implies ", " is acceptable as a separator, which it's not. + ok djm@ + +20100324 + - (dtucker) [contrib/cygwin/ssh-host-config] Mount the Windows directory + containing the services file explicitely case-insensitive. This allows to + tweak the Windows services file reliably. Patch from vinschen at redhat. + +20100321 + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2010/03/08 09:41:27 + [ssh-keygen.1] + sort the list of constraints (to -O); ok djm + - jmc@cvs.openbsd.org 2010/03/10 07:40:35 + [ssh-keygen.1] + typos; from Ross Richardson + closes prs 6334 and 6335 + - djm@cvs.openbsd.org 2010/03/10 23:27:17 + [auth2-pubkey.c] + correct certificate logging and make it more consistent between + authorized_keys and TrustedCAKeys; ok markus@ + - djm@cvs.openbsd.org 2010/03/12 01:06:25 + [servconf.c] + unbreak AuthorizedKeys option with a $HOME-relative path; reported by + vinschen AT redhat.com, ok dtucker@ + - markus@cvs.openbsd.org 2010/03/12 11:37:40 + [servconf.c] + do not prepend AuthorizedKeysFile with getcwd(), unbreaks relative paths + free() (not xfree()) the buffer returned by getcwd() + - djm@cvs.openbsd.org 2010/03/13 21:10:38 + [clientloop.c] + protocol conformance fix: send language tag when disconnecting normally; + spotted by 1.41421 AT gmail.com, ok markus@ deraadt@ + - djm@cvs.openbsd.org 2010/03/13 21:45:46 + [ssh-keygen.1] + Certificates are named *-cert.pub, not *_cert.pub; committing a diff + from stevesk@ ok me + - jmc@cvs.openbsd.org 2010/03/13 23:38:13 + [ssh-keygen.1] + fix a formatting error (args need quoted); noted by stevesk + - stevesk@cvs.openbsd.org 2010/03/15 19:40:02 + [key.c key.h ssh-keygen.c] + also print certificate type (user or host) for ssh-keygen -L + ok djm kettenis + - stevesk@cvs.openbsd.org 2010/03/16 15:46:52 + [auth-options.c] + spelling in error message. ok djm kettenis + - djm@cvs.openbsd.org 2010/03/16 16:36:49 + [version.h] + crank version to openssh-5.5 since we have a few fixes since 5.4; + requested deraadt@ kettenis@ + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank version numbers + +20100314 + - (djm) [ssh-pkcs11-helper.c] Move #ifdef to after #defines to fix + compilation failure when !HAVE_DLOPEN. Reported by felix-mindrot + AT fefe.de + - (djm) [Makefile.in] Respecify -lssh after -lopenbsd-compat for + ssh-pkcs11-helper to repair static builds (we do the same for + ssh-keyscan). Reported by felix-mindrot AT fefe.de + +20100312 + - (tim) [Makefile.in] Now that scard is gone, no need to make $(datadir) + - (tim) [Makefile.in] Add missing $(EXEEXT) to install targets. + Patch from Corinna Vinschen. + - (tim) [contrib/cygwin/Makefile] Fix list of documentation files to install + on a Cygwin installation. Patch from Corinna Vinschen. + +20100311 + - (tim) [contrib/suse/openssh.spec] crank version number here too. + report by imorgan AT nas.nasa.gov + +20100309 + - (dtucker) [configure.ac] Use a proper AC_CHECK_DECL for BROKEN_GETADDRINFO + so setting it in CFLAGS correctly skips IPv6 tests. + +20100428 - (djm) OpenBSD CVS Sync - djm@cvs.openbsd.org 2010/03/07 22:16:01 [ssh-keygen.c] Modified: head/crypto/openssh/README ============================================================================== --- head/crypto/openssh/README Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/README Wed Apr 28 10:36:33 2010 (r207319) @@ -1,4 +1,4 @@ -See http://www.openssh.com/txt/release-5.4 for the release notes. +See http://www.openssh.com/txt/release-5.5 for the release notes. - A Japanese translation of this document and of the OpenSSH FAQ is - available at http://www.unixuser.org/~haruyama/security/openssh/index.html @@ -62,4 +62,4 @@ References - [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 [7] http://www.openssh.com/faq.html -$Id: README,v 1.72 2010/03/07 22:41:02 djm Exp $ +$Id: README,v 1.73 2010/03/21 19:11:55 djm Exp $ Modified: head/crypto/openssh/auth-options.c ============================================================================== --- head/crypto/openssh/auth-options.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/auth-options.c Wed Apr 28 10:36:33 2010 (r207319) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-options.c,v 1.48 2010/03/07 11:57:13 dtucker Exp $ */ +/* $OpenBSD: auth-options.c,v 1.49 2010/03/16 15:46:52 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -434,7 +434,7 @@ auth_cert_constraints(Buffer *c_orig, st goto out; } if (strlen(command) != clen) { - error("force-command constrain contains \\0"); + error("force-command constraint contains \\0"); goto out; } if (cert_forced_command != NULL) { @@ -454,7 +454,7 @@ auth_cert_constraints(Buffer *c_orig, st goto out; } if (strlen(allowed) != clen) { - error("source-address constrain contains \\0"); + error("source-address constraint contains \\0"); goto out; } if (cert_source_address_done++) { Modified: head/crypto/openssh/auth2-pubkey.c ============================================================================== --- head/crypto/openssh/auth2-pubkey.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/auth2-pubkey.c Wed Apr 28 10:36:33 2010 (r207319) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-pubkey.c,v 1.21 2010/03/04 10:36:03 djm Exp $ */ +/* $OpenBSD: auth2-pubkey.c,v 1.22 2010/03/10 23:27:17 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -240,22 +240,26 @@ user_key_allowed2(struct passwd *pw, Key continue; if (!key_equal(found, key->cert->signature_key)) continue; - debug("matching CA found: file %s, line %lu", - file, linenum); fp = key_fingerprint(found, SSH_FP_MD5, SSH_FP_HEX); - verbose("Found matching %s CA: %s", - key_type(found), fp); - xfree(fp); + debug("matching CA found: file %s, line %lu, %s %s", + file, linenum, key_type(found), fp); if (key_cert_check_authority(key, 0, 0, pw->pw_name, &reason) != 0) { + xfree(fp); error("%s", reason); auth_debug_add("%s", reason); continue; } if (auth_cert_constraints(&key->cert->constraints, - pw) != 0) + pw) != 0) { + xfree(fp); continue; + } + verbose("Accepted certificate ID \"%s\" " + "signed by %s CA %s via %s", key->cert->key_id, + key_type(found), fp, file); + xfree(fp); found_key = 1; break; } else if (!key_is_cert_authority && key_equal(found, key)) { @@ -281,15 +285,15 @@ user_key_allowed2(struct passwd *pw, Key static int user_cert_trusted_ca(struct passwd *pw, Key *key) { - char *key_fp, *ca_fp; + char *ca_fp; const char *reason; int ret = 0; if (!key_is_cert(key) || options.trusted_user_ca_keys == NULL) return 0; - key_fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); - ca_fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); + ca_fp = key_fingerprint(key->cert->signature_key, + SSH_FP_MD5, SSH_FP_HEX); if (key_in_file(key->cert->signature_key, options.trusted_user_ca_keys, 1) != 1) { @@ -306,13 +310,12 @@ user_cert_trusted_ca(struct passwd *pw, if (auth_cert_constraints(&key->cert->constraints, pw) != 0) goto out; - verbose("%s certificate %s allowed by trusted %s key %s", - key_type(key), key_fp, key_type(key->cert->signature_key), ca_fp); + verbose("Accepted certificate ID \"%s\" signed by %s CA %s via %s", + key->cert->key_id, key_type(key->cert->signature_key), ca_fp, + options.trusted_user_ca_keys); ret = 1; out: - if (key_fp != NULL) - xfree(key_fp); if (ca_fp != NULL) xfree(ca_fp); return ret; Modified: head/crypto/openssh/channels.c ============================================================================== --- head/crypto/openssh/channels.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/channels.c Wed Apr 28 10:36:33 2010 (r207319) @@ -3252,7 +3252,11 @@ x11_create_display_inet(int x11_display_ sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); if (sock < 0) { - if ((errno != EINVAL) && (errno != EAFNOSUPPORT)) { + if ((errno != EINVAL) && (errno != EAFNOSUPPORT) +#ifdef EPFNOSUPPORT + && (errno != EPFNOSUPPORT) +#endif + ) { error("socket: %.100s", strerror(errno)); freeaddrinfo(aitop); return -1; Modified: head/crypto/openssh/clientloop.c ============================================================================== --- head/crypto/openssh/clientloop.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/clientloop.c Wed Apr 28 10:36:33 2010 (r207319) @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.218 2010/01/28 00:21:18 djm Exp $ */ +/* $OpenBSD: clientloop.c,v 1.219 2010/03/13 21:10:38 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1484,6 +1484,7 @@ client_loop(int have_pty, int escape_cha packet_start(SSH2_MSG_DISCONNECT); packet_put_int(SSH2_DISCONNECT_BY_APPLICATION); packet_put_cstring("disconnected by user"); + packet_put_cstring(""); /* language tag */ packet_send(); packet_write_wait(); } Modified: head/crypto/openssh/config.h ============================================================================== --- head/crypto/openssh/config.h Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/config.h Wed Apr 28 10:36:33 2010 (r207319) @@ -124,7 +124,7 @@ #define DISABLE_WTMPX 1 /* Enable for PKCS#11 support */ -#define ENABLE_PKCS11 +#define ENABLE_PKCS11 /**/ /* Builtin PRNG command timeout */ #define ENTROPY_TIMEOUT_MSEC 200 @@ -456,6 +456,9 @@ /* Define to 1 if you have the `getutxline' function. */ #define HAVE_GETUTXLINE 1 +/* Define to 1 if you have the `getutxuser' function. */ +#define HAVE_GETUTXUSER 1 + /* Define to 1 if you have the `get_default_context_with_level' function. */ /* #undef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL */ @@ -552,6 +555,9 @@ /* Define if system has libiaf that supports set_id */ /* #undef HAVE_LIBIAF */ +/* Define to 1 if you have the `network' library (-lnetwork). */ +/* #undef HAVE_LIBNETWORK */ + /* Define to 1 if you have the `nsl' library (-lnsl). */ /* #undef HAVE_LIBNSL */ @@ -805,6 +811,9 @@ /* Define to 1 if you have the `setutent' function. */ /* #undef HAVE_SETUTENT */ +/* Define to 1 if you have the `setutxdb' function. */ +#define HAVE_SETUTXDB 1 + /* Define to 1 if you have the `setutxent' function. */ #define HAVE_SETUTXENT 1 @@ -1416,8 +1425,8 @@ /* Define if you want SELinux support. */ /* #undef WITH_SELINUX */ -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 #elif ! defined __LITTLE_ENDIAN__ Modified: head/crypto/openssh/config.h.in ============================================================================== --- head/crypto/openssh/config.h.in Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/config.h.in Wed Apr 28 10:36:33 2010 (r207319) @@ -80,9 +80,6 @@ /* Define if you want to specify the path to your lastlog file */ #undef CONF_LASTLOG_FILE -/* Define if you want to specify the path to your utmpx file */ -#undef CONF_UTMPX_FILE - /* Define if you want to specify the path to your utmp file */ #undef CONF_UTMP_FILE @@ -455,6 +452,9 @@ /* Define to 1 if you have the `getutxline' function. */ #undef HAVE_GETUTXLINE +/* Define to 1 if you have the `getutxuser' function. */ +#undef HAVE_GETUTXUSER + /* Define to 1 if you have the `get_default_context_with_level' function. */ #undef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL @@ -551,6 +551,9 @@ /* Define if system has libiaf that supports set_id */ #undef HAVE_LIBIAF +/* Define to 1 if you have the `network' library (-lnetwork). */ +#undef HAVE_LIBNETWORK + /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL @@ -804,6 +807,9 @@ /* Define to 1 if you have the `setutent' function. */ #undef HAVE_SETUTENT +/* Define to 1 if you have the `setutxdb' function. */ +#undef HAVE_SETUTXDB + /* Define to 1 if you have the `setutxent' function. */ #undef HAVE_SETUTXENT Modified: head/crypto/openssh/defines.h ============================================================================== --- head/crypto/openssh/defines.h Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/defines.h Wed Apr 28 10:36:33 2010 (r207319) @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.159 2010/01/13 23:44:34 tim Exp $ */ +/* $Id: defines.h,v 1.160 2010/04/09 08:13:27 dtucker Exp $ */ /* Constants */ Modified: head/crypto/openssh/key.c ============================================================================== --- head/crypto/openssh/key.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/key.c Wed Apr 28 10:36:33 2010 (r207319) @@ -1,4 +1,4 @@ -/* $OpenBSD: key.c,v 1.85 2010/03/04 01:44:57 djm Exp $ */ +/* $OpenBSD: key.c,v 1.86 2010/03/15 19:40:02 stevesk Exp $ */ /* * read_bignum(): * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -802,6 +802,19 @@ key_type(const Key *k) } const char * +key_cert_type(const Key *k) +{ + switch (k->cert->type) { + case SSH2_CERT_TYPE_USER: + return "user"; + case SSH2_CERT_TYPE_HOST: + return "host"; + default: + return "unknown"; + } +} + +const char * key_ssh_name(const Key *k) { switch (k->type) { Modified: head/crypto/openssh/key.h ============================================================================== --- head/crypto/openssh/key.h Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/key.h Wed Apr 28 10:36:33 2010 (r207319) @@ -1,4 +1,4 @@ -/* $OpenBSD: key.h,v 1.28 2010/02/26 20:29:54 djm Exp $ */ +/* $OpenBSD: key.h,v 1.29 2010/03/15 19:40:02 stevesk Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -82,6 +82,7 @@ int key_equal(const Key *, const Key * char *key_fingerprint(Key *, enum fp_type, enum fp_rep); u_char *key_fingerprint_raw(Key *, enum fp_type, u_int *); const char *key_type(const Key *); +const char *key_cert_type(const Key *); int key_write(const Key *, FILE *); int key_read(Key *, char **); u_int key_size(const Key *); Modified: head/crypto/openssh/loginrec.c ============================================================================== --- head/crypto/openssh/loginrec.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/loginrec.c Wed Apr 28 10:36:33 2010 (r207319) @@ -510,6 +510,10 @@ getlast_entry(struct logininfo *li) #ifdef USE_LASTLOG return(lastlog_get_entry(li)); #else /* !USE_LASTLOG */ +#if defined(USE_UTMPX) && defined(HAVE_SETUTXDB) && \ + defined(UTXDB_LASTLOGIN) && defined(HAVE_GETUTXUSER) + return (utmpx_get_entry(li)); +#endif #if 1 return (utmpx_get_entry(li)); @@ -1614,7 +1618,8 @@ lastlog_get_entry(struct logininfo *li) #endif /* HAVE_GETLASTLOGXBYNAME */ #endif /* USE_LASTLOG */ -#if 1 +#if defined(USE_UTMPX) && defined(HAVE_SETUTXDB) && \ + defined(UTXDB_LASTLOGIN) && defined(HAVE_GETUTXUSER) int utmpx_get_entry(struct logininfo *li) { @@ -1637,7 +1642,7 @@ utmpx_get_entry(struct logininfo *li) endutxent(); return (1); } -#endif +#endif /* USE_UTMPX && HAVE_SETUTXDB && UTXDB_LASTLOGIN && HAVE_GETUTXUSER */ #ifdef USE_BTMP /* Modified: head/crypto/openssh/logintest.c ============================================================================== --- head/crypto/openssh/logintest.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/logintest.c Wed Apr 28 10:36:33 2010 (r207319) @@ -264,7 +264,7 @@ showOptions(void) printf("\tUSE_UTMP (UTMP_FILE=%s)\n", UTMP_FILE); #endif #ifdef USE_UTMPX - printf("\tUSE_UTMPX (UTMPX_FILE=%s)\n", UTMPX_FILE); + printf("\tUSE_UTMPX\n"); #endif #ifdef USE_WTMP printf("\tUSE_WTMP (WTMP_FILE=%s)\n", WTMP_FILE); Modified: head/crypto/openssh/openbsd-compat/bsd-arc4random.c ============================================================================== --- head/crypto/openssh/openbsd-compat/bsd-arc4random.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/openbsd-compat/bsd-arc4random.c Wed Apr 28 10:36:33 2010 (r207319) @@ -84,7 +84,7 @@ arc4random_stir(void) } #endif /* !HAVE_ARC4RANDOM */ -#ifndef ARC4RANDOM_BUF +#ifndef HAVE_ARC4RANDOM_BUF void arc4random_buf(void *_buf, size_t n) { @@ -102,7 +102,7 @@ arc4random_buf(void *_buf, size_t n) } #endif /* !HAVE_ARC4RANDOM_BUF */ -#ifndef ARC4RANDOM_UNIFORM +#ifndef HAVE_ARC4RANDOM_UNIFORM /* * Calculate a uniformly distributed random number less than upper_bound * avoiding "modulo bias". Modified: head/crypto/openssh/servconf.c ============================================================================== --- head/crypto/openssh/servconf.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/servconf.c Wed Apr 28 10:36:33 2010 (r207319) @@ -1,4 +1,4 @@ -/* $OpenBSD: servconf.c,v 1.204 2010/03/04 10:36:03 djm Exp $ */ +/* $OpenBSD: servconf.c,v 1.207 2010/03/25 23:38:28 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -474,15 +474,14 @@ parse_token(const char *cp, const char * char * derelativise_path(const char *path) { - char *expanded, *ret, *cwd; + char *expanded, *ret, cwd[MAXPATHLEN]; expanded = tilde_expand_filename(path, getuid()); if (*expanded == '/') return expanded; - if ((cwd = getcwd(NULL, 0)) == NULL) + if (getcwd(cwd, sizeof(cwd)) == NULL) fatal("%s: getcwd: %s", __func__, strerror(errno)); xasprintf(&ret, "%s/%s", cwd, expanded); - xfree(cwd); xfree(expanded); return ret; } @@ -1227,7 +1226,17 @@ process_server_config_line(ServerOptions charptr = (opcode == sAuthorizedKeysFile) ? &options->authorized_keys_file : &options->authorized_keys_file2; - goto parse_filename; + arg = strdelim(&cp); + if (!arg || *arg == '\0') + fatal("%s line %d: missing file name.", + filename, linenum); + if (*activep && *charptr == NULL) { + *charptr = tilde_expand_filename(arg, getuid()); + /* increase optional counter */ + if (intptr != NULL) + *intptr = *intptr + 1; + } + break; case sClientAliveInterval: intptr = &options->client_alive_interval; Modified: head/crypto/openssh/session.c ============================================================================== --- head/crypto/openssh/session.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/session.c Wed Apr 28 10:36:33 2010 (r207319) @@ -1581,6 +1581,10 @@ do_setusercontext(struct passwd *pw) } #endif /* HAVE_SETPCRED */ +#ifdef WITH_SELINUX + ssh_selinux_setup_exec_context(pw->pw_name); +#endif + if (options.chroot_directory != NULL && strcasecmp(options.chroot_directory, "none") != 0) { tmp = tilde_expand_filename(options.chroot_directory, @@ -1605,10 +1609,6 @@ do_setusercontext(struct passwd *pw) if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) fatal("Failed to set uids to %u.", (u_int) pw->pw_uid); - -#ifdef WITH_SELINUX - ssh_selinux_setup_exec_context(pw->pw_name); -#endif } static void Modified: head/crypto/openssh/ssh-keygen.1 ============================================================================== --- head/crypto/openssh/ssh-keygen.1 Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/ssh-keygen.1 Wed Apr 28 10:36:33 2010 (r207319) @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-keygen.1,v 1.88 2010/03/08 00:28:55 djm Exp $ +.\" $OpenBSD: ssh-keygen.1,v 1.92 2010/03/13 23:38:13 jmc Exp $ .\" $FreeBSD$ .\" .\" -*- nroff -*- @@ -38,7 +38,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 8 2010 +.Dd March 13 2010 .Dt SSH-KEYGEN 1 .Os .Sh NAME @@ -308,8 +308,15 @@ Please see the section for details. The constraints that are valid for user certificates are: .Bl -tag -width Ds -.It Ic no-x11-forwarding -Disable X11 forwarding (permitted by default). +.It Ic clear +Clear all enabled permissions. +This is useful for clearing the default set of permissions so permissions may +be added individually. +.It Ic force-command Ns = Ns Ar command +Forces the execution of +.Ar command +instead of any shell or command specified by the user when +the certificate is used for authentication. .It Ic no-agent-forwarding Disable .Xr ssh-agent 1 @@ -324,12 +331,8 @@ Disable execution of by .Xr sshd 8 (permitted by default). -.It Ic clear -Clear all enabled permissions. -This is useful for clearing the default set of permissions so permissions may -be added individually. -.It Ic permit-x11-forwarding -Allows X11 forwarding. +.It Ic no-x11-forwarding +Disable X11 forwarding (permitted by default). .It Ic permit-agent-forwarding Allows .Xr ssh-agent 1 @@ -343,14 +346,10 @@ Allows execution of .Pa ~/.ssh/rc by .Xr sshd 8 . -.It Ic force-command=command -Forces the execution of -.Ar command -instead of any shell or command specified by the user when -the certificate is used for authentication. -.It Ic source-address=address_list -Restrict the source addresses from which the certificate is considered valid -from. +.It Ic permit-x11-forwarding +Allows X11 forwarding. +.It Ic source-address Ns = Ns Ar address_list +Restrict the source addresses from which the certificate is considered valid. The .Ar address_list is a comma-separated list of one or more address/netmask pairs in CIDR @@ -415,7 +414,7 @@ in YYYYMMDDHHMMSS format or a relative t of a minus sign followed by a relative time in the format described in the .Sx TIME FORMATS section of -.Xr ssh_config 5 . +.Xr sshd_config 5 . The end time may be specified as a YYYYMMDD date, a YYYYMMDDHHMMSS time or a relative time starting with a plus character. .Pp @@ -520,7 +519,7 @@ To generate a user certificate: .Dl $ ssh-keygen -s /path/to/ca_key -I key_id /path/to/user_key.pub .Pp The resultant certificate will be placed in -.Pa /path/to/user_key_cert.pub . +.Pa /path/to/user_key-cert.pub . A host certificate requires the .Fl h option: @@ -528,7 +527,7 @@ option: .Dl $ ssh-keygen -s /path/to/ca_key -I key_id -h /path/to/host_key.pub .Pp The host certificate will be output to -.Pa /path/to/host_key_cert.pub . +.Pa /path/to/host_key-cert.pub . In both cases, .Ar key_id is a "key identifier" that is logged by the server when the certificate @@ -540,7 +539,7 @@ By default, generated certificates are v To generate a certificate for a specified set of principals: .Pp .Dl $ ssh-keygen -s ca_key -I key_id -n user1,user2 user_key.pub -.Dl $ ssh-keygen -s ca_key -I key_id -h -n host.domain user_key.pub +.Dl "$ ssh-keygen -s ca_key -I key_id -h -n host.domain user_key.pub" .Pp Additional limitations on the validity and use of user certificates may be specified through certificate constraints. Modified: head/crypto/openssh/ssh-keygen.c ============================================================================== --- head/crypto/openssh/ssh-keygen.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/ssh-keygen.c Wed Apr 28 10:36:33 2010 (r207319) @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keygen.c,v 1.184 2010/03/07 22:16:01 djm Exp $ */ +/* $OpenBSD: ssh-keygen.c,v 1.185 2010/03/15 19:40:02 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1994 Tatu Ylonen , Espoo, Finland @@ -1393,7 +1393,8 @@ do_show_cert(struct passwd *pw) SSH_FP_MD5, SSH_FP_HEX); printf("%s:\n", identity_file); - printf(" %s certificate %s\n", key_type(key), key_fp); + printf(" %s %s certificate %s\n", key_type(key), + key_cert_type(key), key_fp); printf(" Signed by %s CA %s\n", key_type(key->cert->signature_key), ca_fp); printf(" Key ID \"%s\"\n", key->cert->key_id); Modified: head/crypto/openssh/ssh-pkcs11-helper.c ============================================================================== --- head/crypto/openssh/ssh-pkcs11-helper.c Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/ssh-pkcs11-helper.c Wed Apr 28 10:36:33 2010 (r207319) @@ -17,8 +17,6 @@ #include "includes.h" -#ifdef ENABLE_PKCS11 - #include #ifdef HAVE_SYS_TIME_H # include @@ -39,6 +37,8 @@ #include "authfd.h" #include "ssh-pkcs11.h" +#ifdef ENABLE_PKCS11 + /* borrows code from sftp-server and ssh-agent */ struct pkcs11_keyinfo { Modified: head/crypto/openssh/ssh.1 ============================================================================== --- head/crypto/openssh/ssh.1 Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/ssh.1 Wed Apr 28 10:36:33 2010 (r207319) @@ -34,9 +34,9 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $OpenBSD: ssh.1,v 1.302 2010/03/05 10:28:21 djm Exp $ +.\" $OpenBSD: ssh.1,v 1.303 2010/03/26 00:26:58 djm Exp $ .\" $FreeBSD$ -.Dd March 5 2010 +.Dd March 26 2010 .Dt SSH 1 .Os .Sh NAME @@ -560,7 +560,10 @@ argument is the listen port will be dynamically allocated on the server and reported to the client at run time. .It Fl S Ar ctl_path -Specifies the location of a control socket for connection sharing. +Specifies the location of a control socket for connection sharing +or the string +.Dq none +to disable connection sharing. Refer to the description of .Cm ControlPath and Modified: head/crypto/openssh/ssh_config ============================================================================== --- head/crypto/openssh/ssh_config Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/ssh_config Wed Apr 28 10:36:33 2010 (r207319) @@ -46,4 +46,4 @@ # PermitLocalCommand no # VisualHostKey no # ProxyCommand ssh -q -W %h:%p gateway.example.com -# VersionAddendum FreeBSD-20100308 +# VersionAddendum FreeBSD-20100428 Modified: head/crypto/openssh/ssh_config.5 ============================================================================== --- head/crypto/openssh/ssh_config.5 Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/ssh_config.5 Wed Apr 28 10:36:33 2010 (r207319) @@ -34,9 +34,9 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $OpenBSD: ssh_config.5,v 1.129 2010/03/05 10:28:21 djm Exp $ +.\" $OpenBSD: ssh_config.5,v 1.130 2010/03/26 01:06:13 dtucker Exp $ .\" $FreeBSD$ -.Dd March 5 2010 +.Dd March 26 2010 .Dt SSH_CONFIG 5 .Os .Sh NAME @@ -735,11 +735,7 @@ This allows a client to prefer one metho over another method (e.g.\& .Cm password ) The default for this option is: -.Do gssapi-with-mic , -hostbased, -publickey, -keyboard-interactive, -password +.Do gssapi-with-mic,hostbased,publickey,keyboard-interactive,password .Dc . .It Cm Protocol Specifies the protocol versions @@ -1087,7 +1083,7 @@ in Specifies a string to append to the regular version string to identify OS- or site-specific modifications. The default is -.Dq FreeBSD-20100308 . +.Dq FreeBSD-20100428 . .It Cm VisualHostKey If this flag is set to .Dq yes , Modified: head/crypto/openssh/sshd_config ============================================================================== --- head/crypto/openssh/sshd_config Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/sshd_config Wed Apr 28 10:36:33 2010 (r207319) @@ -14,7 +14,7 @@ # Note that some of FreeBSD's defaults differ from OpenBSD's, and # FreeBSD has a few additional options. -#VersionAddendum FreeBSD-20100308 +#VersionAddendum FreeBSD-20100428 #Port 22 #AddressFamily any Modified: head/crypto/openssh/sshd_config.5 ============================================================================== --- head/crypto/openssh/sshd_config.5 Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/sshd_config.5 Wed Apr 28 10:36:33 2010 (r207319) @@ -988,7 +988,7 @@ The default is Specifies a string to append to the regular version string to identify OS- or site-specific modifications. The default is -.Dq FreeBSD-20100308 . +.Dq FreeBSD-20100428 . .It Cm X11DisplayOffset Specifies the first display number available for .Xr sshd 8 Ns 's Modified: head/crypto/openssh/version.h ============================================================================== --- head/crypto/openssh/version.h Wed Apr 28 10:33:41 2010 (r207318) +++ head/crypto/openssh/version.h Wed Apr 28 10:36:33 2010 (r207319) @@ -1,12 +1,12 @@ -/* $OpenBSD: version.h,v 1.57 2010/03/07 22:01:32 djm Exp $ */ +/* $OpenBSD: version.h,v 1.58 2010/03/16 16:36:49 djm Exp $ */ /* $FreeBSD$ */ #ifndef SSH_VERSION #define SSH_VERSION (ssh_version_get()) #define SSH_RELEASE (ssh_version_get()) -#define SSH_VERSION_BASE "OpenSSH_5.4p1" -#define SSH_VERSION_ADDENDUM "FreeBSD-20100308" +#define SSH_VERSION_BASE "OpenSSH_5.5p1" +#define SSH_VERSION_ADDENDUM "FreeBSD-20100428" const char *ssh_version_get(void); void ssh_version_set_addendum(const char *); From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 10:57:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79AE6106566B; Wed, 28 Apr 2010 10:57:27 +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 68A948FC1B; Wed, 28 Apr 2010 10:57: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 o3SAvRUp009726; Wed, 28 Apr 2010 10:57:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SAvRpH009723; Wed, 28 Apr 2010 10:57:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004281057.o3SAvRpH009723@svn.freebsd.org> From: Rui Paulo Date: Wed, 28 Apr 2010 10:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207320 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 10:57:27 -0000 Author: rpaulo Date: Wed Apr 28 10:57:27 2010 New Revision: 207320 URL: http://svn.freebsd.org/changeset/base/207320 Log: Fix typos. Obtained from: DragonFlyBSD Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Apr 28 10:36:33 2010 (r207319) +++ head/sbin/ifconfig/ifconfig.8 Wed Apr 28 10:57:27 2010 (r207320) @@ -1163,9 +1163,9 @@ In particular the information elements i for old devices are different. When compatibility support is enabled both standard and compatible data will be provided. -Stations that associate using the compatiblity mechanisms are flagged +Stations that associate using the compatibility mechanisms are flagged in ``list sta''. -To disable compatiblity support use +To disable compatibility support use .Fl htcompat . .It Cm htprotmode Ar technique For interfaces operating in 802.11n, use the specified Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Wed Apr 28 10:36:33 2010 (r207319) +++ head/sbin/ifconfig/ifieee80211.c Wed Apr 28 10:57:27 2010 (r207320) @@ -5027,7 +5027,7 @@ DECL_CMD_FUNC(set80211clone_wlanaddr, ar ea = ether_aton(arg); if (ea == NULL) - errx(1, "%s: cannot parse addres", arg); + errx(1, "%s: cannot parse address", arg); memcpy(params.icp_macaddr, ea->octet, IEEE80211_ADDR_LEN); params.icp_flags |= IEEE80211_CLONE_MACADDR; } From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 10:58:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D36991065672; Wed, 28 Apr 2010 10:58:03 +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 A93A98FC1A; Wed, 28 Apr 2010 10:58:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3SAw3M3009892; Wed, 28 Apr 2010 10:58:03 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SAw35H009890; Wed, 28 Apr 2010 10:58:03 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004281058.o3SAw35H009890@svn.freebsd.org> From: Rui Paulo Date: Wed, 28 Apr 2010 10:58: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: r207321 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 10:58:03 -0000 Author: rpaulo Date: Wed Apr 28 10:58:03 2010 New Revision: 207321 URL: http://svn.freebsd.org/changeset/base/207321 Log: Bump man page date. Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Apr 28 10:57:27 2010 (r207320) +++ head/sbin/ifconfig/ifconfig.8 Wed Apr 28 10:58:03 2010 (r207321) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd February 20, 2010 +.Dd April 28, 2010 .Dt IFCONFIG 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 10:58:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 187721065670; Wed, 28 Apr 2010 10:58:51 +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 07D428FC2A; Wed, 28 Apr 2010 10:58: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 o3SAwovQ010091; Wed, 28 Apr 2010 10:58:50 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SAwoa4010089; Wed, 28 Apr 2010 10:58:50 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004281058.o3SAwoa4010089@svn.freebsd.org> From: Rui Paulo Date: Wed, 28 Apr 2010 10:58: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: r207322 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 10:58:51 -0000 Author: rpaulo Date: Wed Apr 28 10:58:50 2010 New Revision: 207322 URL: http://svn.freebsd.org/changeset/base/207322 Log: Fix typo. No functional change. Obtained from: DragonFlyBSD Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Wed Apr 28 10:58:03 2010 (r207321) +++ head/sys/net80211/ieee80211_node.c Wed Apr 28 10:58:50 2010 (r207322) @@ -432,7 +432,7 @@ ieee80211_reset_bss(struct ieee80211vap ieee80211_reset_erp(ic); ni = ieee80211_alloc_node(&ic->ic_sta, vap, vap->iv_myaddr); - KASSERT(ni != NULL, ("unable to setup inital BSS node")); + KASSERT(ni != NULL, ("unable to setup initial BSS node")); obss = vap->iv_bss; vap->iv_bss = ieee80211_ref_node(ni); if (obss != NULL) { From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 13:25:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B37C3106566C; Wed, 28 Apr 2010 13:25:54 +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 261A28FC1A; Wed, 28 Apr 2010 13:25: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 o3SDPsRM042548; Wed, 28 Apr 2010 13:25:54 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SDPsKE042545; Wed, 28 Apr 2010 13:25:54 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004281325.o3SDPsKE042545@svn.freebsd.org> From: Rui Paulo Date: Wed, 28 Apr 2010 13:25: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: r207323 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 13:25:54 -0000 Author: rpaulo Date: Wed Apr 28 13:25:53 2010 New Revision: 207323 URL: http://svn.freebsd.org/changeset/base/207323 Log: When in the RUN -> AUTH -> RUN FSM transition happens, we'll call the ratectl_node_init() functions and since ni_rtctls was already malloc'ed() we will panic. Fix this by using the already malloc'ed pointer. Found by: bschmidt Reviewed by: bschmidt Modified: head/sys/net80211/ieee80211_amrr.c head/sys/net80211/ieee80211_rssadapt.c Modified: head/sys/net80211/ieee80211_amrr.c ============================================================================== --- head/sys/net80211/ieee80211_amrr.c Wed Apr 28 10:58:50 2010 (r207322) +++ head/sys/net80211/ieee80211_amrr.c Wed Apr 28 13:25:53 2010 (r207323) @@ -136,16 +136,16 @@ amrr_node_init(struct ieee80211_node *ni struct ieee80211_amrr *amrr = vap->iv_rs; struct ieee80211_amrr_node *amn; - KASSERT(ni->ni_rctls == NULL, ("%s: ni_rctls already initialized", - __func__)); - - ni->ni_rctls = amn = malloc(sizeof(struct ieee80211_amrr_node), - M_80211_RATECTL, M_NOWAIT|M_ZERO); - if (amn == NULL) { - if_printf(vap->iv_ifp, "couldn't alloc per-node ratectl " - "structure\n"); - return; - } + if (ni->ni_rctls == NULL) { + ni->ni_rctls = amn = malloc(sizeof(struct ieee80211_amrr_node), + M_80211_RATECTL, M_NOWAIT|M_ZERO); + if (amn == NULL) { + if_printf(vap->iv_ifp, "couldn't alloc per-node ratectl " + "structure\n"); + return; + } + } else + amn = ni->ni_rctls; amn->amn_amrr = amrr; amn->amn_success = 0; amn->amn_recovery = 0; Modified: head/sys/net80211/ieee80211_rssadapt.c ============================================================================== --- head/sys/net80211/ieee80211_rssadapt.c Wed Apr 28 10:58:50 2010 (r207322) +++ head/sys/net80211/ieee80211_rssadapt.c Wed Apr 28 13:25:53 2010 (r207323) @@ -169,13 +169,17 @@ rssadapt_node_init(struct ieee80211_node struct ieee80211_rssadapt *rsa = vap->iv_rs; const struct ieee80211_rateset *rs = &ni->ni_rates; - ni->ni_rctls = ra = malloc(sizeof(struct ieee80211_rssadapt_node), - M_80211_RATECTL, M_NOWAIT|M_ZERO); - if (ra == NULL) { - if_printf(vap->iv_ifp, "couldn't alloc per-node ratectl " - "structure\n"); - return; - } + if (ni->ni_rctls == NULL) { + ni->ni_rctls = ra = + malloc(sizeof(struct ieee80211_rssadapt_node), + M_80211_RATECTL, M_NOWAIT|M_ZERO); + if (ra == NULL) { + if_printf(vap->iv_ifp, "couldn't alloc per-node ratectl " + "structure\n"); + return; + } + } else + ra = ni->ni_rctls; ra->ra_rs = rsa; ra->ra_rates = *rs; rssadapt_updatestats(ra); From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 13:26:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2037106567B; Wed, 28 Apr 2010 13:26:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B03A88FC0C; Wed, 28 Apr 2010 13:26: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 o3SDQUOI042715; Wed, 28 Apr 2010 13:26:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SDQUcl042713; Wed, 28 Apr 2010 13:26:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201004281326.o3SDQUcl042713@svn.freebsd.org> From: Ed Maste Date: Wed, 28 Apr 2010 13:26: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: r207324 - stable/7/tools/tools/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 13:26:30 -0000 Author: emaste Date: Wed Apr 28 13:26:30 2010 New Revision: 207324 URL: http://svn.freebsd.org/changeset/base/207324 Log: MFC r175406: Eliminate warnings by adding headers. Modified: stable/7/tools/tools/aac/aac_checkq.c Directory Properties: stable/7/tools/tools/aac/ (props changed) Modified: stable/7/tools/tools/aac/aac_checkq.c ============================================================================== --- stable/7/tools/tools/aac/aac_checkq.c Wed Apr 28 13:25:53 2010 (r207323) +++ stable/7/tools/tools/aac/aac_checkq.c Wed Apr 28 13:26:30 2010 (r207324) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include /* * Simple program to print out the queue stats on the given queue index. From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 13:29:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C8ED106566B; Wed, 28 Apr 2010 13:29:48 +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 686098FC08; Wed, 28 Apr 2010 13:29:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3SDTmo0043464; Wed, 28 Apr 2010 13:29:48 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SDTmRN043461; Wed, 28 Apr 2010 13:29:48 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004281329.o3SDTmRN043461@svn.freebsd.org> From: Rui Paulo Date: Wed, 28 Apr 2010 13: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: r207325 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 13:29:48 -0000 Author: rpaulo Date: Wed Apr 28 13:29:48 2010 New Revision: 207325 URL: http://svn.freebsd.org/changeset/base/207325 Log: Couple of fixes from DragonFly (typos). Obtained from: DragonFlyBSD Modified: head/share/man/man9/ieee80211.9 head/share/man/man9/ieee80211_node.9 Modified: head/share/man/man9/ieee80211.9 ============================================================================== --- head/share/man/man9/ieee80211.9 Wed Apr 28 13:26:30 2010 (r207324) +++ head/share/man/man9/ieee80211.9 Wed Apr 28 13:29:48 2010 (r207325) @@ -25,11 +25,11 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2010 -.Dt NET80211 9 +.Dd April 28, 2010 +.Dt IEEE80211 9 .Os .Sh NAME -.Nm net80211 +.Nm IEEE80211 .Nd 802.11 network layer .Sh SYNOPSIS .In net80211/ieee80211_var.h Modified: head/share/man/man9/ieee80211_node.9 ============================================================================== --- head/share/man/man9/ieee80211_node.9 Wed Apr 28 13:26:30 2010 (r207324) +++ head/share/man/man9/ieee80211_node.9 Wed Apr 28 13:29:48 2010 (r207325) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2010 +.Dd April 28, 2010 .Dt IEEE80211_NODE 9 .Os .Sh NAME @@ -152,7 +152,7 @@ displays the contents of a single node w .Fn ieee80211_dump_nodes displays the contents of the specified node table. Nodes may also be displayed using -.Xr ddb 9 +.Xr ddb 4 with the .Dq show node directive and the station node table can be displayed with From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 13:42:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B6D6106566C; Wed, 28 Apr 2010 13:42:13 +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 7A2E58FC18; Wed, 28 Apr 2010 13:42: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 o3SDgDq0046223; Wed, 28 Apr 2010 13:42:13 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SDgD2M046221; Wed, 28 Apr 2010 13:42:13 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004281342.o3SDgD2M046221@svn.freebsd.org> From: Rui Paulo Date: Wed, 28 Apr 2010 13:42: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: r207326 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 13:42:13 -0000 Author: rpaulo Date: Wed Apr 28 13:42:13 2010 New Revision: 207326 URL: http://svn.freebsd.org/changeset/base/207326 Log: Add ic_rxstream and ic_txstream. These variables hold the number of RX streams and the number of TX streams respectively. Obtained from: //depot/user/rpaulo/80211n/... Sponsored by: iXsystems, inc. Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Wed Apr 28 13:29:48 2010 (r207325) +++ head/sys/net80211/ieee80211_var.h Wed Apr 28 13:42:13 2010 (r207326) @@ -213,6 +213,8 @@ struct ieee80211com { enum ieee80211_protmode ic_htprotmode; /* HT protection mode */ int ic_lastnonerp; /* last time non-ERP sta noted*/ int ic_lastnonht; /* last time non-HT sta noted */ + uint8_t ic_rxstream; /* # RX streams */ + uint8_t ic_txstream; /* # TX streams */ /* optional state for Atheros SuperG protocol extensions */ struct ieee80211_superg *ic_superg; @@ -315,7 +317,6 @@ struct ieee80211com { void (*ic_ampdu_rx_stop)(struct ieee80211_node *, struct ieee80211_rx_ampdu *); uint64_t ic_spare[7]; - uint32_t ic_spare2; }; struct ieee80211_aclator; From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 14:59:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50781065672; Wed, 28 Apr 2010 14:59:05 +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 A469D8FC15; Wed, 28 Apr 2010 14:59: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 o3SEx5Dd063253; Wed, 28 Apr 2010 14:59:05 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SEx5nZ063236; Wed, 28 Apr 2010 14:59:05 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004281459.o3SEx5nZ063236@svn.freebsd.org> From: Rui Paulo Date: Wed, 28 Apr 2010 14:59: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: r207327 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 14:59:05 -0000 Author: rpaulo Date: Wed Apr 28 14:59:05 2010 New Revision: 207327 URL: http://svn.freebsd.org/changeset/base/207327 Log: Add a private field to struct ieee80211_rx_ampdu do hold driver specific data. Sponsored by: iXsystems, inc Modified: head/sys/net80211/ieee80211_ht.h Modified: head/sys/net80211/ieee80211_ht.h ============================================================================== --- head/sys/net80211/ieee80211_ht.h Wed Apr 28 13:42:13 2010 (r207326) +++ head/sys/net80211/ieee80211_ht.h Wed Apr 28 14:59:05 2010 (r207327) @@ -142,6 +142,7 @@ struct ieee80211_rx_ampdu { int rxa_age; /* age of oldest frame in window */ int rxa_nframes; /* frames since ADDBA */ struct mbuf *rxa_m[IEEE80211_AGGR_BAWMAX]; + void *rxa_private; uint64_t rxa_pad[4]; }; From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 15:15:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAE3E1065674; Wed, 28 Apr 2010 15:15:06 +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 983588FC1B; Wed, 28 Apr 2010 15:15: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 o3SFF6gf066870; Wed, 28 Apr 2010 15:15:06 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SFF6WL066869; Wed, 28 Apr 2010 15:15:06 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004281515.o3SFF6WL066869@svn.freebsd.org> From: Rui Paulo Date: Wed, 28 Apr 2010 15:15: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: r207328 - stable/8/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 15:15:06 -0000 Author: rpaulo Date: Wed Apr 28 15:15:06 2010 New Revision: 207328 URL: http://svn.freebsd.org/changeset/base/207328 Log: MFC r206617: Make this code a little more portable by wrapping the mtx calls into macros. Modified: stable/8/sys/net80211/ieee80211_freebsd.h stable/8/sys/net80211/ieee80211_scan_sta.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/net80211/ieee80211_freebsd.h ============================================================================== --- stable/8/sys/net80211/ieee80211_freebsd.h Wed Apr 28 14:59:05 2010 (r207327) +++ stable/8/sys/net80211/ieee80211_freebsd.h Wed Apr 28 15:15:06 2010 (r207328) @@ -148,6 +148,16 @@ typedef struct mtx acl_lock_t; mtx_assert((&(_as)->as_lock), MA_OWNED) /* + * Scan table definitions. + */ +typedef struct mtx ieee80211_scan_table_lock_t; +#define IEEE80211_SCAN_TABLE_LOCK_INIT(_st, _name) \ + mtx_init(&(_st)->st_lock, _name, "802.11 scan table", MTX_DEF) +#define IEEE80211_SCAN_TABLE_LOCK_DESTROY(_st) mtx_destroy(&(_st)->st_lock) +#define IEEE80211_SCAN_TABLE_LOCK(_st) mtx_lock(&(_st)->st_lock) +#define IEEE80211_SCAN_TABLE_UNLOCK(_st) mtx_unlock(&(_st)->st_lock) + +/* * Node reference counting definitions. * * ieee80211_node_initref initialize the reference count to 1 Modified: stable/8/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- stable/8/sys/net80211/ieee80211_scan_sta.c Wed Apr 28 14:59:05 2010 (r207327) +++ stable/8/sys/net80211/ieee80211_scan_sta.c Wed Apr 28 15:15:06 2010 (r207328) @@ -97,7 +97,7 @@ struct sta_entry { CTASSERT(MAX_IEEE_CHAN >= 256); struct sta_table { - struct mtx st_lock; /* on scan table */ + ieee80211_scan_table_lock_t st_lock; /* on scan table */ TAILQ_HEAD(, sta_entry) st_entry; /* all entries */ LIST_HEAD(, sta_entry) st_hash[STA_HASHSIZE]; struct mtx st_scanlock; /* on st_scaniter */ @@ -161,7 +161,7 @@ sta_attach(struct ieee80211_scan_state * M_80211_SCAN, M_NOWAIT | M_ZERO); if (st == NULL) return 0; - mtx_init(&st->st_lock, "scantable", "802.11 scan table", MTX_DEF); + IEEE80211_SCAN_TABLE_LOCK_INIT(st, "scantable"); mtx_init(&st->st_scanlock, "scangen", "802.11 scangen", MTX_DEF); TAILQ_INIT(&st->st_entry); ss->ss_priv = st; @@ -179,7 +179,7 @@ sta_detach(struct ieee80211_scan_state * if (st != NULL) { sta_flush_table(st); - mtx_destroy(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK_DESTROY(st); mtx_destroy(&st->st_scanlock); free(st, M_80211_SCAN); KASSERT(nrefs > 0, ("imbalanced attach/detach")); @@ -196,9 +196,9 @@ sta_flush(struct ieee80211_scan_state *s { struct sta_table *st = ss->ss_priv; - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); sta_flush_table(st); - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); ss->ss_last = 0; return 0; } @@ -244,14 +244,14 @@ sta_add(struct ieee80211_scan_state *ss, hash = STA_HASH(macaddr); - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); LIST_FOREACH(se, &st->st_hash[hash], se_hash) if (IEEE80211_ADDR_EQ(se->base.se_macaddr, macaddr)) goto found; se = (struct sta_entry *) malloc(sizeof(struct sta_entry), M_80211_SCAN, M_NOWAIT | M_ZERO); if (se == NULL) { - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); return 0; } se->se_scangen = st->st_scaniter-1; @@ -370,7 +370,7 @@ found: if (rssi > st->st_maxrssi[sp->bchan]) st->st_maxrssi[sp->bchan] = rssi; - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); /* * If looking for a quick choice and nothing's @@ -1132,7 +1132,7 @@ sta_update_notseen(struct sta_table *st) { struct sta_entry *se; - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); TAILQ_FOREACH(se, &st->st_entry, se_list) { /* * If seen the reset and don't bump the count; @@ -1146,7 +1146,7 @@ sta_update_notseen(struct sta_table *st) else se->se_notseen++; } - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); } static void @@ -1154,11 +1154,11 @@ sta_dec_fails(struct sta_table *st) { struct sta_entry *se; - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); TAILQ_FOREACH(se, &st->st_entry, se_list) if (se->se_fails) se->se_fails--; - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); } static struct sta_entry * @@ -1169,7 +1169,7 @@ select_bss(struct ieee80211_scan_state * IEEE80211_DPRINTF(vap, debug, " %s\n", "macaddr bssid chan rssi rate flag wep essid"); - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); TAILQ_FOREACH(se, &st->st_entry, se_list) { ieee80211_ies_expand(&se->base.se_ies); if (match_bss(vap, ss, se, debug) == 0) { @@ -1179,7 +1179,7 @@ select_bss(struct ieee80211_scan_state * selbs = se; } } - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); return selbs; } @@ -1258,11 +1258,11 @@ sta_lookup(struct sta_table *st, const u struct sta_entry *se; int hash = STA_HASH(macaddr); - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); LIST_FOREACH(se, &st->st_hash[hash], se_hash) if (IEEE80211_ADDR_EQ(se->base.se_macaddr, macaddr)) break; - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); return se; /* NB: unlocked */ } @@ -1382,18 +1382,18 @@ sta_iterate(struct ieee80211_scan_state mtx_lock(&st->st_scanlock); gen = st->st_scaniter++; restart: - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); TAILQ_FOREACH(se, &st->st_entry, se_list) { if (se->se_scangen != gen) { se->se_scangen = gen; /* update public state */ se->base.se_age = ticks - se->se_lastupdate; - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); (*f)(arg, &se->base); goto restart; } } - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); mtx_unlock(&st->st_scanlock); } @@ -1510,7 +1510,7 @@ adhoc_pick_channel(struct ieee80211_scan bestchan = NULL; bestrssi = -1; - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); for (i = 0; i < ss->ss_last; i++) { c = ss->ss_chans[i]; /* never consider a channel with radar */ @@ -1532,7 +1532,7 @@ adhoc_pick_channel(struct ieee80211_scan if (bestchan == NULL || maxrssi < bestrssi) bestchan = c; } - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); return bestchan; } @@ -1638,7 +1638,7 @@ adhoc_age(struct ieee80211_scan_state *s struct sta_table *st = ss->ss_priv; struct sta_entry *se, *next; - mtx_lock(&st->st_lock); + IEEE80211_SCAN_TABLE_LOCK(st); TAILQ_FOREACH_SAFE(se, &st->st_entry, se_list, next) { if (se->se_notseen > STA_PURGE_SCANS) { TAILQ_REMOVE(&st->st_entry, se, se_list); @@ -1647,7 +1647,7 @@ adhoc_age(struct ieee80211_scan_state *s free(se, M_80211_SCAN); } } - mtx_unlock(&st->st_lock); + IEEE80211_SCAN_TABLE_UNLOCK(st); } static const struct ieee80211_scanner adhoc_default = { From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 15:37:00 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA00C106564A; Wed, 28 Apr 2010 15:37:00 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail2.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id A83B08FC21; Wed, 28 Apr 2010 15:37:00 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com ([192.168.3.11]) by mail2.sandvine.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 28 Apr 2010 11:36:59 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 71D2511703; Wed, 28 Apr 2010 11:36:59 -0400 (EDT) Date: Wed, 28 Apr 2010 11:36:59 -0400 From: Ed Maste To: Jilles Tjoelker , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20100428153659.GA42914@sandvine.com> References: <201004252043.o3PKhJi7065713@svn.freebsd.org> <20100427035224.GA87611@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100427035224.GA87611@nagual.pp.ru> User-Agent: Mutt/1.4.2.1i X-OriginalArrivalTime: 28 Apr 2010 15:36:59.0427 (UTC) FILETIME=[A4268730:01CAE6E8] Cc: Subject: Re: svn commit: r207206 - 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, 28 Apr 2010 15:37:01 -0000 On Tue, Apr 27, 2010 at 07:52:25AM +0400, Andrey Chernov wrote: > Just wonder, do you have plans to implement ${!variable} sometimes? > This bashism is very useful: ... While we're on this topic, I'll mention the bashism I'd like to see support for -- array variables. Older versions supported only one-dimensional numeric indicies. http://tldp.org/LDP/abs/html/arrays.html foo[1]=abc foo[2]=def echo ${foo[1]} ${foo[2]} Bash 4 adds associative arrays. foo[bar]=ghi foo[baz]=jkl echo ${foo[bar]} ${foo[baz]} echo ${foo[*]} -Ed From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 15:38:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A686106566C; Wed, 28 Apr 2010 15:38:01 +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 870C78FC1B; Wed, 28 Apr 2010 15:38: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 o3SFc1P5071890; Wed, 28 Apr 2010 15:38:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SFc1Ao071881; Wed, 28 Apr 2010 15:38:01 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201004281538.o3SFc1Ao071881@svn.freebsd.org> From: Attilio Rao Date: Wed, 28 Apr 2010 15:38: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: r207329 - in head/sys: amd64/amd64 amd64/include dev/io i386/i386 i386/include ia64/ia64 ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 15:38:01 -0000 Author: attilio Date: Wed Apr 28 15:38:01 2010 New Revision: 207329 URL: http://svn.freebsd.org/changeset/base/207329 Log: - Extract the IODEV_PIO interface from ia64 and make it MI. In the end, it does help fixing /dev/io usage from multithreaded processes. - On i386 and amd64 the old behaviour is kept but multithreaded processes must use the new interface in order to work well. - Support for the other architectures is greatly improved, where necessary, by the necessity to define very small things now. Manpage update will happen shortly. Sponsored by: Sandvine Incorporated PR: threads/116181 Reviewed by: emaste, marcel MFC after: 3 weeks Added: head/sys/dev/io/iodev.h (contents, props changed) Modified: head/sys/amd64/amd64/io.c head/sys/amd64/include/iodev.h head/sys/dev/io/iodev.c head/sys/i386/i386/io.c head/sys/i386/include/iodev.h head/sys/ia64/ia64/iodev_machdep.c head/sys/ia64/include/iodev.h Modified: head/sys/amd64/amd64/io.c ============================================================================== --- head/sys/amd64/amd64/io.c Wed Apr 28 15:15:06 2010 (r207328) +++ head/sys/amd64/amd64/io.c Wed Apr 28 15:38:01 2010 (r207329) @@ -28,60 +28,32 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include - -#include -#include - #include +#include -/* ARGSUSED */ int -ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td) +iodev_open(struct thread *td) { - int error; - - error = priv_check(td, PRIV_IO); - if (error != 0) - return (error); - error = securelevel_gt(td->td_ucred, 0); - if (error != 0) - return (error); td->td_frame->tf_rflags |= PSL_IOPL; - return (0); } -/* ARGSUSED */ int -ioclose(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td) +iodev_close(struct thread *td) { - td->td_frame->tf_rflags &= ~PSL_IOPL; + td->td_frame->tf_rflags &= ~PSL_IOPL; return (0); } /* ARGSUSED */ int -ioioctl(struct cdev *dev __unused, u_long cmd __unused, caddr_t data __unused, - int fflag __unused, struct thread *td __unused) +iodev_ioctl(u_long cmd __unused, caddr_t data __unused) { - return (ENXIO); + return (ENOIOCTL); } Modified: head/sys/amd64/include/iodev.h ============================================================================== --- head/sys/amd64/include/iodev.h Wed Apr 28 15:15:06 2010 (r207328) +++ head/sys/amd64/include/iodev.h Wed Apr 28 15:38:01 2010 (r207329) @@ -25,7 +25,22 @@ * * $FreeBSD$ */ +#ifndef _MACHINE_IODEV_H_ +#define _MACHINE_IODEV_H_ -d_open_t ioopen; -d_close_t ioclose; -d_ioctl_t ioioctl; +#ifdef _KERNEL +#include + +#define iodev_read_1 inb +#define iodev_read_2 inw +#define iodev_read_4 inl +#define iodev_write_1 outb +#define iodev_write_2 outw +#define iodev_write_4 outl + +int iodev_open(struct thread *td); +int iodev_close(struct thread *td); +int iodev_ioctl(u_long cmd, caddr_t data); + +#endif /* _KERNEL */ +#endif /* _MACHINE_IODEV_H_ */ Modified: head/sys/dev/io/iodev.c ============================================================================== --- head/sys/dev/io/iodev.c Wed Apr 28 15:15:06 2010 (r207328) +++ head/sys/dev/io/iodev.c Wed Apr 28 15:38:01 2010 (r207329) @@ -30,22 +30,27 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include -#include +#include #include -#include +#include #include -#include #include -#include - -#include -#include #include +#include + +static int ioopen(struct cdev *dev, int flags, int fmt, + struct thread *td); +static int ioclose(struct cdev *dev, int flags, int fmt, + struct thread *td); +static int ioioctl(struct cdev *dev, u_long cmd, caddr_t data, + int fflag, struct thread *td); + +static int iopio_read(struct iodev_pio_req *req); +static int iopio_write(struct iodev_pio_req *req); + static struct cdev *iodev; static struct cdevsw io_cdevsw = { @@ -58,6 +63,129 @@ static struct cdevsw io_cdevsw = { /* ARGSUSED */ static int +ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused, + struct thread *td) +{ + int error; + + error = priv_check(td, PRIV_IO); + if (error != 0) + return (error); + error = securelevel_gt(td->td_ucred, 0); + if (error != 0) + return (error); + error = iodev_open(td); + + return (error); +} + +/* ARGSUSED */ +static int +ioclose(struct cdev *dev __unused, int flags __unused, int fmt __unused, + struct thread *td) +{ + + return (iodev_close(td)); +} + +/* ARGSUSED */ +static int +ioioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, + int fflag __unused, struct thread *td __unused) +{ + struct iodev_pio_req *pio_req; + int error; + + switch (cmd) { + case IODEV_PIO: + pio_req = (struct iodev_pio_req *)data; + switch (pio_req->access) { + case IODEV_PIO_READ: + error = iopio_read(pio_req); + break; + case IODEV_PIO_WRITE: + error = iopio_write(pio_req); + break; + default: + error = EINVAL; + break; + } + break; + default: + error = iodev_ioctl(cmd, data); + } + + return (error); +} + +static int +iopio_read(struct iodev_pio_req *req) +{ + + switch (req->width) { + case 1: + req->val = iodev_read_1(req->port); + break; + case 2: + if (req->port & 1) { + req->val = iodev_read_1(req->port); + req->val |= iodev_read_1(req->port + 1) << 8; + } else + req->val = iodev_read_2(req->port); + break; + case 4: + if (req->port & 1) { + req->val = iodev_read_1(req->port); + req->val |= iodev_read_2(req->port + 1) << 8; + req->val |= iodev_read_1(req->port + 3) << 24; + } else if (req->port & 2) { + req->val = iodev_read_2(req->port); + req->val |= iodev_read_2(req->port + 2) << 16; + } else + req->val = iodev_read_4(req->port); + break; + default: + return (EINVAL); + } + + return (0); +} + +static int +iopio_write(struct iodev_pio_req *req) +{ + + switch (req->width) { + case 1: + iodev_write_1(req->port, req->val); + break; + case 2: + if (req->port & 1) { + iodev_write_1(req->port, req->val); + iodev_write_1(req->port + 1, req->val >> 8); + } else + iodev_write_2(req->port, req->val); + break; + case 4: + if (req->port & 1) { + iodev_write_1(req->port, req->val); + iodev_write_2(req->port + 1, req->val >> 8); + iodev_write_1(req->port + 3, req->val >> 24); + } else if (req->port & 2) { + iodev_write_2(req->port, req->val); + iodev_write_2(req->port + 2, req->val >> 16); + } else + iodev_write_4(req->port, req->val); + break; + default: + return (EINVAL); + } + + return (0); +} + +/* ARGSUSED */ +static int io_modevent(module_t mod __unused, int type, void *data __unused) { switch(type) { Added: head/sys/dev/io/iodev.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/io/iodev.h Wed Apr 28 15:38:01 2010 (r207329) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2010 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_IODEV_H_ +#define _DEV_IODEV_H_ + +#define IODEV_PIO_READ 0 +#define IODEV_PIO_WRITE 1 + +struct iodev_pio_req { + u_int access; + u_int port; + u_int width; + u_int val; +}; + +#define IODEV_PIO _IOWR('I', 0, struct iodev_pio_req) + +#endif /* _DEV_IODEV_H_ */ Modified: head/sys/i386/i386/io.c ============================================================================== --- head/sys/i386/i386/io.c Wed Apr 28 15:15:06 2010 (r207328) +++ head/sys/i386/i386/io.c Wed Apr 28 15:38:01 2010 (r207329) @@ -28,60 +28,32 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include -#include - -#include -#include - #include +#include -/* ARGSUSED */ int -ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td) +iodev_open(struct thread *td) { - int error; - - error = priv_check(td, PRIV_IO); - if (error != 0) - return (error); - error = securelevel_gt(td->td_ucred, 0); - if (error != 0) - return (error); td->td_frame->tf_eflags |= PSL_IOPL; - return (0); } -/* ARGSUSED */ int -ioclose(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td) +iodev_close(struct thread *td) { - td->td_frame->tf_eflags &= ~PSL_IOPL; + td->td_frame->tf_eflags &= ~PSL_IOPL; return (0); } /* ARGSUSED */ int -ioioctl(struct cdev *dev __unused, u_long cmd __unused, caddr_t data __unused, - int fflag __unused, struct thread *td __unused) +iodev_ioctl(u_long cmd __unused, caddr_t data __unused) { - return (ENXIO); + return (ENOIOCTL); } Modified: head/sys/i386/include/iodev.h ============================================================================== --- head/sys/i386/include/iodev.h Wed Apr 28 15:15:06 2010 (r207328) +++ head/sys/i386/include/iodev.h Wed Apr 28 15:38:01 2010 (r207329) @@ -25,7 +25,22 @@ * * $FreeBSD$ */ +#ifndef _MACHINE_IODEV_H_ +#define _MACHINE_IODEV_H_ -d_open_t ioopen; -d_close_t ioclose; -d_ioctl_t ioioctl; +#ifdef _KERNEL +#include + +#define iodev_read_1 inb +#define iodev_read_2 inw +#define iodev_read_4 inl +#define iodev_write_1 outb +#define iodev_write_2 outw +#define iodev_write_4 outl + +int iodev_open(struct thread *td); +int iodev_close(struct thread *td); +int iodev_ioctl(u_long cmd, caddr_t data); + +#endif /* _KERNEL */ +#endif /* _MACHINE_IODEV_H_ */ Modified: head/sys/ia64/ia64/iodev_machdep.c ============================================================================== --- head/sys/ia64/ia64/iodev_machdep.c Wed Apr 28 15:15:06 2010 (r207328) +++ head/sys/ia64/ia64/iodev_machdep.c Wed Apr 28 15:38:01 2010 (r207329) @@ -40,61 +40,33 @@ __FBSDID("$FreeBSD$"); #include #include -static int iodev_pio_read(struct iodev_pio_req *req); -static int iodev_pio_write(struct iodev_pio_req *req); - static int iodev_efivar_getvar(struct iodev_efivar_req *req); static int iodev_efivar_nextname(struct iodev_efivar_req *req); static int iodev_efivar_setvar(struct iodev_efivar_req *req); /* ARGSUSED */ int -ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td) +iodev_open(struct thread *td __unused) { - int error; - - error = priv_check(td, PRIV_IO); - if (error == 0) - error = securelevel_gt(td->td_ucred, 0); - return (error); + return (0); } /* ARGSUSED */ int -ioclose(struct cdev *dev __unused, int flags __unused, int fmt __unused, - struct thread *td __unused) +iodev_close(struct thread *td __unused) { return (0); } -/* ARGSUSED */ int -ioioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, - int fflag __unused, struct thread *td __unused) +iodev_ioctl(u_long cmd, caddr_t data) { struct iodev_efivar_req *efivar_req; - struct iodev_pio_req *pio_req; int error; - error = ENOIOCTL; switch (cmd) { - case IODEV_PIO: - pio_req = (struct iodev_pio_req *)data; - switch (pio_req->access) { - case IODEV_PIO_READ: - error = iodev_pio_read(pio_req); - break; - case IODEV_PIO_WRITE: - error = iodev_pio_write(pio_req); - break; - default: - error = EINVAL; - break; - } - break; case IODEV_EFIVAR: efivar_req = (struct iodev_efivar_req *)data; efivar_req->result = 0; /* So it's well-defined */ @@ -113,75 +85,11 @@ ioioctl(struct cdev *dev __unused, u_lon break; } break; - } - - return (error); -} - -static int -iodev_pio_read(struct iodev_pio_req *req) -{ - - switch (req->width) { - case 1: - req->val = bus_space_read_io_1(req->port); - break; - case 2: - if (req->port & 1) { - req->val = bus_space_read_io_1(req->port); - req->val |= bus_space_read_io_1(req->port + 1) << 8; - } else - req->val = bus_space_read_io_2(req->port); - break; - case 4: - if (req->port & 1) { - req->val = bus_space_read_io_1(req->port); - req->val |= bus_space_read_io_2(req->port + 1) << 8; - req->val |= bus_space_read_io_1(req->port + 3) << 24; - } else if (req->port & 2) { - req->val = bus_space_read_io_2(req->port); - req->val |= bus_space_read_io_2(req->port + 2) << 16; - } else - req->val = bus_space_read_io_4(req->port); - break; - default: - return (EINVAL); - } - - return (0); -} - -static int -iodev_pio_write(struct iodev_pio_req *req) -{ - - switch (req->width) { - case 1: - bus_space_write_io_1(req->port, req->val); - break; - case 2: - if (req->port & 1) { - bus_space_write_io_1(req->port, req->val); - bus_space_write_io_1(req->port + 1, req->val >> 8); - } else - bus_space_write_io_2(req->port, req->val); - break; - case 4: - if (req->port & 1) { - bus_space_write_io_1(req->port, req->val); - bus_space_write_io_2(req->port + 1, req->val >> 8); - bus_space_write_io_1(req->port + 3, req->val >> 24); - } else if (req->port & 2) { - bus_space_write_io_2(req->port, req->val); - bus_space_write_io_2(req->port + 2, req->val >> 16); - } else - bus_space_write_io_4(req->port, req->val); - break; default: - return (EINVAL); + error = ENOIOCTL; } - return (0); + return (error); } static int Modified: head/sys/ia64/include/iodev.h ============================================================================== --- head/sys/ia64/include/iodev.h Wed Apr 28 15:15:06 2010 (r207328) +++ head/sys/ia64/include/iodev.h Wed Apr 28 15:38:01 2010 (r207329) @@ -31,22 +31,16 @@ #include -struct iodev_pio_req { - u_int access; -#define IODEV_PIO_READ 0 -#define IODEV_PIO_WRITE 1 - u_int port; - u_int width; - u_int val; -}; - -#define IODEV_PIO _IOWR('I', 0, struct iodev_pio_req) +#ifdef _KERNEL +#include +#endif -struct iodev_efivar_req { - u_int access; #define IODEV_EFIVAR_GETVAR 0 #define IODEV_EFIVAR_NEXTNAME 1 #define IODEV_EFIVAR_SETVAR 2 + +struct iodev_efivar_req { + u_int access; u_int result; /* errno value */ size_t namesize; u_short *name; /* UCS-2 */ @@ -59,11 +53,16 @@ struct iodev_efivar_req { #define IODEV_EFIVAR _IOWR('I', 1, struct iodev_efivar_req) #ifdef _KERNEL +#define iodev_read_1 bus_space_read_io_1 +#define iodev_read_2 bus_space_read_io_2 +#define iodev_read_4 bus_space_read_io_4 +#define iodev_write_1 bus_space_write_io_1 +#define iodev_write_2 bus_space_write_io_2 +#define iodev_write_4 bus_space_write_io_4 + +int iodev_open(struct thread *td); +int iodev_close(struct thread *td); +int iodev_ioctl(u_long, caddr_t data); -d_open_t ioopen; -d_close_t ioclose; -d_ioctl_t ioioctl; - -#endif - +#endif /* _KERNEL */ #endif /* _MACHINE_IODEV_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 15:46:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1321A106564A; Wed, 28 Apr 2010 15:46:02 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5D0088FC1C; Wed, 28 Apr 2010 15:46:00 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA14687; Wed, 28 Apr 2010 18:45:58 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4BD85835.8050806@freebsd.org> Date: Wed, 28 Apr 2010 18:45:57 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100319) MIME-Version: 1.0 To: Ed Maste , ache@nagual.pp.ru References: <201004252043.o3PKhJi7065713@svn.freebsd.org> <20100427035224.GA87611@nagual.pp.ru> <20100428153659.GA42914@sandvine.com> In-Reply-To: <20100428153659.GA42914@sandvine.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207206 - 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, 28 Apr 2010 15:46:02 -0000 on 28/04/2010 18:36 Ed Maste said the following: > On Tue, Apr 27, 2010 at 07:52:25AM +0400, Andrey Chernov wrote: > >> Just wonder, do you have plans to implement ${!variable} sometimes? >> This bashism is very useful: > ... > > While we're on this topic, I'll mention the bashism I'd like to see > support for -- array variables. Half-jokingly: why don't you just use bash (your favorite version of it) or submit your proposals to POSIX? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 17:26:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5605B106564A; Wed, 28 Apr 2010 17:26:06 +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 456A68FC29; Wed, 28 Apr 2010 17:26: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 o3SHQ6Z8095647; Wed, 28 Apr 2010 17:26:06 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SHQ6xN095645; Wed, 28 Apr 2010 17:26:06 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201004281726.o3SHQ6xN095645@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 28 Apr 2010 17:26: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: r207330 - head/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 17:26:06 -0000 Author: jkim Date: Wed Apr 28 17:26:05 2010 New Revision: 207330 URL: http://svn.freebsd.org/changeset/base/207330 Log: Remove dead code. Calculated greatest common divisor was not used at all. On top of that, LLVM+Clang mis-compiles this code because of its register allocator bug. Analyzed by: Andrew Reilly (areilly at bigpond dot net dot au) Reviewed by: ariff, rdivacky MFC after: 3 days Modified: head/sys/dev/sound/pcm/buffer.c Modified: head/sys/dev/sound/pcm/buffer.c ============================================================================== --- head/sys/dev/sound/pcm/buffer.c Wed Apr 28 15:38:01 2010 (r207329) +++ head/sys/dev/sound/pcm/buffer.c Wed Apr 28 17:26:05 2010 (r207330) @@ -568,7 +568,6 @@ sndbuf_updateprevtotal(struct snd_dbuf * unsigned int snd_xbytes(unsigned int v, unsigned int from, unsigned int to) { - unsigned int w, x, y; if (from == to) return v; @@ -576,16 +575,6 @@ snd_xbytes(unsigned int v, unsigned int if (from == 0 || to == 0 || v == 0) return 0; - x = from; - y = to; - while (y != 0) { - w = x % y; - x = y; - y = w; - } - from /= x; - to /= x; - return (unsigned int)(((u_int64_t)v * to) / from); } From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 17:37:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF178106564A; Wed, 28 Apr 2010 17:37:30 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE3AF8FC0A; Wed, 28 Apr 2010 17:37:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3SHbUKO098215; Wed, 28 Apr 2010 17:37:30 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SHbUpo098213; Wed, 28 Apr 2010 17:37:30 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201004281737.o3SHbUpo098213@svn.freebsd.org> From: Jack F Vogel Date: Wed, 28 Apr 2010 17:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207331 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 17:37:30 -0000 Author: jfv Date: Wed Apr 28 17:37:30 2010 New Revision: 207331 URL: http://svn.freebsd.org/changeset/base/207331 Log: Change default WOL back to MAGIC only, having multicast enabled causes problems in man environments. Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Apr 28 17:26:05 2010 (r207330) +++ head/sys/dev/e1000/if_em.c Wed Apr 28 17:37:30 2010 (r207331) @@ -2707,10 +2707,10 @@ em_setup_interface(device_t dev, struct ifp->if_capabilities |= IFCAP_POLLING; #endif - /* Enable All WOL methods by default */ + /* Enable only WOL MAGIC by default */ if (adapter->wol) { ifp->if_capabilities |= IFCAP_WOL; - ifp->if_capenable |= IFCAP_WOL; + ifp->if_capenable |= IFCAP_WOL_MAGIC; } /* From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 17:40:12 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F16B91065679 for ; Wed, 28 Apr 2010 17:40:12 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id 436918FC17 for ; Wed, 28 Apr 2010 17:40:12 +0000 (UTC) Received: (qmail 16945 invoked by uid 399); 28 Apr 2010 17:40:11 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 28 Apr 2010 17:40:11 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4BD872F9.7070703@FreeBSD.org> Date: Wed, 28 Apr 2010 10:40:09 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: Ed Maste References: <201004252043.o3PKhJi7065713@svn.freebsd.org> <20100427035224.GA87611@nagual.pp.ru> <20100428153659.GA42914@sandvine.com> In-Reply-To: <20100428153659.GA42914@sandvine.com> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jilles Tjoelker , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r207206 - 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, 28 Apr 2010 17:40:13 -0000 On 04/28/10 08:36, Ed Maste wrote: > While we're on this topic, I'll mention the bashism I'd like to see > support for ... and I'd like to cast a vote for NOT bloating our sh with features from more advanced shells. Either we should actually import one of the more advanced shells (and no, I don't want to start that bikeshed, especially not on the svn list) or we should continue down the path Jilles is taking of cleaning up the shell we have. I think Jilles is on the right path. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 17:49:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79B141065672; Wed, 28 Apr 2010 17:49:04 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id B61BB8FC18; Wed, 28 Apr 2010 17:49:03 +0000 (UTC) Received: by qyk11 with SMTP id 11so18472179qyk.13 for ; Wed, 28 Apr 2010 10:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=2wZHpxLqze+deTJsgUTOMcsvhUwuUWrARW6CVfWYsLg=; b=VZkFfkX2gv731eUjHojz7mEvFt/50dQzvfuy6heyVRMUXMYv5luwnMXJC0lA1J0iEW iWwxk0mz5nX4AhElIEy3Rnznj6pREj3+JZVpsSNg87cUIneT800wEDhwDXCRDhQFELMF nAPtCbpY9nxNjRCoJSSFPDuibc3SDV6LLnL8k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=MaXMIISxPwTT2fvDsMGKdW4YtsinwUGZEnVF3dhVoVkQajsBLy+Tnx0Uuc+rFLfbEN QXLBOKmBPxqZvRQI+yqJP9WvUWBHLR8D7Tc2Lu7qKP/uHpHlvQeT+ts+AR/AXJ+OoXGz zrKwRXB9QAPf/lR0eO+2TgYzsEq2bCWM19Da8= MIME-Version: 1.0 Received: by 10.229.221.65 with SMTP id ib1mr9783219qcb.47.1272476928438; Wed, 28 Apr 2010 10:48:48 -0700 (PDT) Received: by 10.229.233.11 with HTTP; Wed, 28 Apr 2010 10:48:48 -0700 (PDT) In-Reply-To: <4BD872F9.7070703@FreeBSD.org> References: <201004252043.o3PKhJi7065713@svn.freebsd.org> <20100427035224.GA87611@nagual.pp.ru> <20100428153659.GA42914@sandvine.com> <4BD872F9.7070703@FreeBSD.org> Date: Wed, 28 Apr 2010 10:48:48 -0700 Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Maste Subject: Re: svn commit: r207206 - 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, 28 Apr 2010 17:49:04 -0000 On Wed, Apr 28, 2010 at 10:40 AM, Doug Barton wrote: > On 04/28/10 08:36, Ed Maste wrote: >> While we're on this topic, I'll mention the bashism I'd like to see >> support for > > ... and I'd like to cast a vote for NOT bloating our sh with features > from more advanced shells. Either we should actually import one of the > more advanced shells (and no, I don't want to start that bikeshed, > especially not on the svn list) or we should continue down the path > Jilles is taking of cleaning up the shell we have. > > I think Jilles is on the right path. Completely and wholeheartedly agree. -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 18:28:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51672106566B; Wed, 28 Apr 2010 18:28:09 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F52D8FC16; Wed, 28 Apr 2010 18:28:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3SIS9Vi009440; Wed, 28 Apr 2010 18:28:09 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SIS96B009438; Wed, 28 Apr 2010 18:28:09 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201004281828.o3SIS96B009438@svn.freebsd.org> From: Jack F Vogel Date: Wed, 28 Apr 2010 18:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207332 - stable/8/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 18:28:09 -0000 Author: jfv Date: Wed Apr 28 18:28:08 2010 New Revision: 207332 URL: http://svn.freebsd.org/changeset/base/207332 Log: Only enable MAGIC WOL by default, MCAST causes systems to just wakeup immediately in many environments. Modified: stable/8/sys/dev/e1000/if_em.c Modified: stable/8/sys/dev/e1000/if_em.c ============================================================================== --- stable/8/sys/dev/e1000/if_em.c Wed Apr 28 17:37:30 2010 (r207331) +++ stable/8/sys/dev/e1000/if_em.c Wed Apr 28 18:28:08 2010 (r207332) @@ -2707,10 +2707,10 @@ em_setup_interface(device_t dev, struct ifp->if_capabilities |= IFCAP_POLLING; #endif - /* Enable All WOL methods by default */ + /* Enable only WOL MAGIC by default */ if (adapter->wol) { ifp->if_capabilities |= IFCAP_WOL; - ifp->if_capenable |= IFCAP_WOL; + ifp->if_capenable |= IFCAP_WOL_MAGIC; } /* From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 18:29:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AFCF1065670; Wed, 28 Apr 2010 18:29:49 +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 08FB08FC29; Wed, 28 Apr 2010 18: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 o3SITmX0009870; Wed, 28 Apr 2010 18:29:48 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SITmG3009868; Wed, 28 Apr 2010 18:29:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004281829.o3SITmG3009868@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 28 Apr 2010 18: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: r207334 - 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, 28 Apr 2010 18:29:49 -0000 Author: pjd Date: Wed Apr 28 18:29:48 2010 New Revision: 207334 URL: http://svn.freebsd.org/changeset/base/207334 Log: Backport fix for 'zfs_znode_dmu_init: existing znode for dbuf' panic from OpenSolaris. PR: kern/144402 Reported by: Alex Bakhtin Tested by: Alex Bakhtin Obtained from: OpenSolaris, Bug ID 6895088 MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Apr 28 18:29:44 2010 (r207333) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Apr 28 18:29:48 2010 (r207334) @@ -704,6 +704,8 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d DMU_OT_ZNODE, sizeof (znode_phys_t) + bonuslen, tx); } } + + ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); VERIFY(0 == dmu_bonus_hold(zfsvfs->z_os, obj, NULL, &db)); dmu_buf_will_dirty(db, tx); @@ -765,9 +767,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d pzp->zp_mode = MAKEIMODE(vap->va_type, vap->va_mode); if (!(flag & IS_ROOT_NODE)) { - ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); *zpp = zfs_znode_alloc(zfsvfs, db, 0); - ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); } else { /* * If we are creating the root node, the "parent" we @@ -776,6 +776,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d *zpp = dzp; } zfs_perm_init(*zpp, dzp, flag, vap, tx, cr, setaclp, fuidp); + ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); if (!(flag & IS_ROOT_NODE)) { vnode_t *vp; @@ -939,19 +940,31 @@ again: /* * Not found create new znode/vnode + * but only if file exists. + * + * There is a small window where zfs_vget() could + * find this object while a file create is still in + * progress. Since a gen number can never be zero + * we will check that to determine if its an allocated + * file. */ - zp = zfs_znode_alloc(zfsvfs, db, doi.doi_data_block_size); - - vp = ZTOV(zp); - vp->v_vflag |= VV_FORCEINSMQ; - err = insmntque(vp, zfsvfs->z_vfs); - vp->v_vflag &= ~VV_FORCEINSMQ; - KASSERT(err == 0, ("insmntque() failed: error %d", err)); - VOP_UNLOCK(vp, 0); + if (((znode_phys_t *)db->db_data)->zp_gen != 0) { + zp = zfs_znode_alloc(zfsvfs, db, doi.doi_data_block_size); + *zpp = zp; + vp = ZTOV(zp); + vp->v_vflag |= VV_FORCEINSMQ; + err = insmntque(vp, zfsvfs->z_vfs); + vp->v_vflag &= ~VV_FORCEINSMQ; + KASSERT(err == 0, ("insmntque() failed: error %d", err)); + VOP_UNLOCK(vp, 0); + err = 0; + } else { + dmu_buf_rele(db, NULL); + err = ENOENT; + } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); - *zpp = zp; - return (0); + return (err); } int @@ -1440,6 +1453,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, uint64_t norm = 0; nvpair_t *elem; int error; + int i; znode_t *rootzp = NULL; vnode_t vnode; vattr_t vattr; @@ -1537,6 +1551,9 @@ zfs_create_fs(objset_t *os, cred_t *cr, list_create(&zfsvfs.z_all_znodes, sizeof (znode_t), offsetof(znode_t, z_link_node)); + for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) + mutex_init(&zfsvfs.z_hold_mtx[i], NULL, MUTEX_DEFAULT, NULL); + ASSERT(!POINTER_IS_VALID(rootzp->z_zfsvfs)); rootzp->z_zfsvfs = &zfsvfs; zfs_mknode(rootzp, &vattr, tx, cr, IS_ROOT_NODE, &zp, 0, NULL, NULL); @@ -1547,6 +1564,8 @@ zfs_create_fs(objset_t *os, cred_t *cr, dmu_buf_rele(rootzp->z_dbuf, NULL); rootzp->z_dbuf = NULL; + for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) + mutex_destroy(&zfsvfs.z_hold_mtx[i]); mutex_destroy(&zfsvfs.z_znodes_lock); rootzp->z_vnode = NULL; kmem_cache_free(znode_cache, rootzp); From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 18:49:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B60B1065673; Wed, 28 Apr 2010 18:49:46 +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 3A2398FC0C; Wed, 28 Apr 2010 18:49: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 o3SInk0c014271; Wed, 28 Apr 2010 18:49:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SInkv3014269; Wed, 28 Apr 2010 18:49:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201004281849.o3SInkv3014269@svn.freebsd.org> From: John Baldwin Date: Wed, 28 Apr 2010 18:49: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: r207335 - head/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 18:49:46 -0000 Author: jhb Date: Wed Apr 28 18:49:45 2010 New Revision: 207335 URL: http://svn.freebsd.org/changeset/base/207335 Log: Initialize the callout structure earlier in attach before calling any routines that can fail since ciss_free() always tries to stop and drain the callout. Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Wed Apr 28 18:29:48 2010 (r207334) +++ head/sys/dev/ciss/ciss.c Wed Apr 28 18:49:45 2010 (r207335) @@ -417,6 +417,7 @@ ciss_attach(device_t dev) sc = device_get_softc(dev); sc->ciss_dev = dev; mtx_init(&sc->ciss_mtx, "cissmtx", NULL, MTX_DEF); + callout_init_mtx(&sc->ciss_periodic, &sc->ciss_mtx, 0); /* * Do PCI-specific init. @@ -429,7 +430,6 @@ ciss_attach(device_t dev) */ ciss_initq_free(sc); ciss_initq_notify(sc); - callout_init_mtx(&sc->ciss_periodic, &sc->ciss_mtx, 0); /* * Initalize device sysctls. From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 19:22:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22C06106566B; Wed, 28 Apr 2010 19:22:53 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 117578FC20; Wed, 28 Apr 2010 19:22: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 o3SJMqva021605; Wed, 28 Apr 2010 19:22:52 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SJMquZ021603; Wed, 28 Apr 2010 19:22:52 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201004281922.o3SJMquZ021603@svn.freebsd.org> From: Jack F Vogel Date: Wed, 28 Apr 2010 19:22: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: r207337 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 19:22:53 -0000 Author: jfv Date: Wed Apr 28 19:22:52 2010 New Revision: 207337 URL: http://svn.freebsd.org/changeset/base/207337 Log: Address the LOD that some are seeing, put the RX lock back in rxeof (I could see little point in taking it out), and now release it before the stack entry. Also, make it so the 82574 does not configure for multiqueue when its not used in the stack. Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Apr 28 18:55:46 2010 (r207336) +++ head/sys/dev/e1000/if_em.c Wed Apr 28 19:22:52 2010 (r207337) @@ -347,8 +347,13 @@ static int em_debug_sbp = FALSE; TUNABLE_INT("hw.em.sbp", &em_debug_sbp); /* Local controls for MSI/MSIX */ +#ifdef EM_MULTIQUEUE static int em_enable_msix = TRUE; static int em_msix_queues = 2; /* for 82574, can be 1 or 2 */ +#else +static int em_enable_msix = FALSE; +static int em_msix_queues = 0; /* disable */ +#endif TUNABLE_INT("hw.em.enable_msix", &em_enable_msix); TUNABLE_INT("hw.em.msix_queues", &em_msix_queues); @@ -1371,9 +1376,7 @@ em_poll(struct ifnet *ifp, enum poll_cmd } EM_CORE_UNLOCK(adapter); - EM_RX_LOCK(rxr); rx_done = em_rxeof(rxr, count); - EM_RX_UNLOCK(rxr); EM_TX_LOCK(txr); em_txeof(txr); @@ -1449,9 +1452,7 @@ em_handle_que(void *context, int pending if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - EM_RX_LOCK(rxr); more_rx = em_rxeof(rxr, adapter->rx_process_limit); - EM_RX_UNLOCK(rxr); EM_TX_LOCK(txr); em_txeof(txr); @@ -1511,10 +1512,8 @@ em_msix_rx(void *arg) struct adapter *adapter = rxr->adapter; bool more; - EM_RX_LOCK(rxr); ++rxr->rx_irq; more = em_rxeof(rxr, adapter->rx_process_limit); - EM_RX_UNLOCK(rxr); if (more) taskqueue_enqueue(rxr->tq, &rxr->rx_task); else @@ -1553,9 +1552,7 @@ em_handle_rx(void *context, int pending) struct adapter *adapter = rxr->adapter; bool more; - EM_RX_LOCK(rxr); more = em_rxeof(rxr, adapter->rx_process_limit); - EM_RX_UNLOCK(rxr); if (more) taskqueue_enqueue(rxr->tq, &rxr->rx_task); else @@ -4100,7 +4097,7 @@ em_rxeof(struct rx_ring *rxr, int count) bool eop; struct e1000_rx_desc *cur; - EM_RX_LOCK_ASSERT(rxr); + EM_RX_LOCK(rxr); for (i = rxr->next_to_check, processed = 0; count != 0;) { @@ -4194,8 +4191,13 @@ skip: i = 0; /* Send to the stack */ - if (sendmp != NULL) + if (sendmp != NULL) { + rxr->next_to_check = i; + EM_RX_UNLOCK(rxr); (*ifp->if_input)(ifp, sendmp); + EM_RX_LOCK(rxr); + i = rxr->next_to_check; + } /* Only refresh mbufs every 8 descriptors */ if (processed == 8) { @@ -4211,6 +4213,7 @@ skip: } rxr->next_to_check = i; + EM_RX_UNLOCK(rxr); #ifdef DEVICE_POLLING return (rxdone); From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 21:50:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 585B61065673; Wed, 28 Apr 2010 21:50:59 +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 433128FC15; Wed, 28 Apr 2010 21:50: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 o3SLoxO9056246; Wed, 28 Apr 2010 21:50:59 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SLow2N056233; Wed, 28 Apr 2010 21:50:58 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201004282150.o3SLow2N056233@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 28 Apr 2010 21:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207340 - in vendor-sys/acpica/dist: . common compiler debugger events executer include os_specific/service_layers tables tests tests/misc tools/acpiexec tools/acpisrc utilities X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 21:50:59 -0000 Author: jkim Date: Wed Apr 28 21:50:57 2010 New Revision: 207340 URL: http://svn.freebsd.org/changeset/base/207340 Log: Import ACPICA 20100428. Added: vendor-sys/acpica/dist/compiler/aslrestype1i.c (contents, props changed) vendor-sys/acpica/dist/compiler/aslrestype2d.c (contents, props changed) vendor-sys/acpica/dist/compiler/aslrestype2e.c (contents, props changed) vendor-sys/acpica/dist/compiler/aslrestype2q.c (contents, props changed) vendor-sys/acpica/dist/compiler/aslrestype2w.c (contents, props changed) vendor-sys/acpica/dist/events/evgpeinit.c (contents, props changed) vendor-sys/acpica/dist/events/evgpeutil.c (contents, props changed) vendor-sys/acpica/dist/tests/ vendor-sys/acpica/dist/tests/misc/ vendor-sys/acpica/dist/tests/misc/badcode.asl vendor-sys/acpica/dist/tests/misc/grammar.asl Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/common/adisasm.c vendor-sys/acpica/dist/compiler/Makefile vendor-sys/acpica/dist/compiler/aslcompile.c vendor-sys/acpica/dist/compiler/aslcompiler.h vendor-sys/acpica/dist/compiler/asldefine.h vendor-sys/acpica/dist/compiler/aslfiles.c vendor-sys/acpica/dist/compiler/aslglobal.h vendor-sys/acpica/dist/compiler/asllisting.c vendor-sys/acpica/dist/compiler/aslmain.c vendor-sys/acpica/dist/compiler/aslpredef.c vendor-sys/acpica/dist/compiler/aslresource.c vendor-sys/acpica/dist/compiler/aslrestype1.c vendor-sys/acpica/dist/compiler/aslrestype2.c vendor-sys/acpica/dist/compiler/asltypes.h vendor-sys/acpica/dist/debugger/dbcmds.c vendor-sys/acpica/dist/debugger/dbdisply.c vendor-sys/acpica/dist/events/evgpe.c vendor-sys/acpica/dist/events/evgpeblk.c vendor-sys/acpica/dist/executer/exconfig.c vendor-sys/acpica/dist/executer/exoparg1.c vendor-sys/acpica/dist/executer/exsystem.c vendor-sys/acpica/dist/include/acevents.h vendor-sys/acpica/dist/include/acglobal.h vendor-sys/acpica/dist/include/acinterp.h vendor-sys/acpica/dist/include/aclocal.h vendor-sys/acpica/dist/include/acpiosxf.h vendor-sys/acpica/dist/include/acpixf.h vendor-sys/acpica/dist/include/actypes.h vendor-sys/acpica/dist/include/amlresrc.h vendor-sys/acpica/dist/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/osunixxf.c vendor-sys/acpica/dist/tables/tbfind.c vendor-sys/acpica/dist/tables/tbinstal.c vendor-sys/acpica/dist/tables/tbutils.c vendor-sys/acpica/dist/tables/tbxface.c vendor-sys/acpica/dist/tools/acpiexec/Makefile vendor-sys/acpica/dist/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/tools/acpiexec/aetables.c vendor-sys/acpica/dist/tools/acpisrc/astable.c vendor-sys/acpica/dist/utilities/utcopy.c vendor-sys/acpica/dist/utilities/utglobal.c vendor-sys/acpica/dist/utilities/uttrack.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/changes.txt Wed Apr 28 21:50:57 2010 (r207340) @@ -1,4 +1,70 @@ ---------------------------------------- +28 April 2010. Summary of changes for version 20100428: + +1) ACPI CA Core Subsystem: + +Implemented GPE support for dynamically loaded ACPI tables. For all GPEs, +including FADT-based and GPE Block Devices, execute any _PRW methods in the +new table, and process any _Lxx/_Exx GPE methods in the new table. Any +runtime GPE that is referenced by an _Lxx/_Exx method in the new table is +immediately enabled. Handles the FADT-defined GPEs as well as GPE Block +Devices. Provides compatibility with other ACPI implementations. Two new +files added, evgpeinit.c and evgpeutil.c. ACPICA BZ 833. Lin Ming, Bob Moore. + +Fixed a regression introduced in version 20100331 within the table manager +where initial table loading could fail. This was introduced in the fix for +AcpiReallocateRootTable. Also, renamed some of fields in the table manager +data structures to clarify their meaning and use. + +Fixed a possible allocation overrun during internal object copy in +AcpiUtCopySimpleObject. The original code did not correctly handle the case +where the object to be copied was a namespace node. Lin Ming. ACPICA BZ 847. + +Updated the allocation dump routine, AcpiUtDumpAllocation and fixed a +possible access beyond end-of-allocation. Also, now fully validate descriptor +(size and type) before output. Lin Ming, Bob Moore. ACPICA BZ 847 + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 87.9K Code, 18.6K Data, 106.5K Total + Debug Version: 163.5K Code, 51.3K Data, 214.8K Total + Current Release: + Non-Debug Version: 88.4K Code, 18.8K Data, 107.2K Total + Debug Version: 164.2K Code, 51.5K Data, 215.7K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented Min/Max/Len/Gran validation for address resource +descriptors. This change implements validation for the address fields that +are common to all address-type resource descriptors. These checks are +implemented: Checks for valid Min/Max, length within the Min/Max window, +valid granularity, Min/Max a multiple of granularity, and _MIF/_MAF as per +table 6-40 in the ACPI 4.0a specification. Also split the large aslrestype1.c +and aslrestype2.c files into five new files. ACPICA BZ 840. + +iASL: Added support for the _Wxx predefined names. This support was missing +and these names were not recognized by the compiler as valid predefined +names. ACPICA BZ 851. + +iASL: Added an error for all predefined names that are defined to return no +value and thus must be implemented as Control Methods. These include all of +the _Lxx, _Exx, _Wxx, and _Qxx names, as well as some other miscellaneous +names such as _DIS, _INI, _IRC, _OFF, _ON, and _PSx. ACPICA BZ 850, 856. + +iASL: Implemented the -ts option to emit hex AML data in ASL format, as an +ASL Buffer. Allows ACPI tables to be easily included within ASL files, to be +dynamically loaded via the Load() operator. Also cleaned up output for the - +ta and -tc options. ACPICA BZ 853. + +Tests: Added a new file with examples of extended iASL error checking. +Demonstrates the advanced error checking ability of the iASL compiler. +Available at tests/misc/badcode.asl. + +---------------------------------------- 31 March 2010. Summary of changes for version 20100331: 1) ACPI CA Core Subsystem: Modified: vendor-sys/acpica/dist/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/common/adisasm.c Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/common/adisasm.c Wed Apr 28 21:50:57 2010 (r207340) @@ -282,8 +282,8 @@ AdInitialize ( /* Setup the Table Manager (cheat - there is no RSDT) */ - AcpiGbl_RootTableList.Size = 1; - AcpiGbl_RootTableList.Count = 0; + AcpiGbl_RootTableList.MaxTableCount = 1; + AcpiGbl_RootTableList.CurrentTableCount = 0; AcpiGbl_RootTableList.Tables = LocalTables; return (Status); @@ -1156,7 +1156,7 @@ AdParseTable ( /* If LoadTable is FALSE, we are parsing the last loaded table */ - TableIndex = AcpiGbl_RootTableList.Count - 1; + TableIndex = AcpiGbl_RootTableList.CurrentTableCount - 1; /* Pass 2 */ Modified: vendor-sys/acpica/dist/compiler/Makefile ============================================================================== --- vendor-sys/acpica/dist/compiler/Makefile Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/compiler/Makefile Wed Apr 28 21:50:57 2010 (r207340) @@ -1,11 +1,37 @@ - PROG= iasl -SRCS= aslcompilerparse.c aslcompilerlex.c aslanalyze.c aslcodegen.c \ - aslcompile.c aslerror.c aslfiles.c asllength.c \ - asllisting.c aslload.c asllookup.c aslmain.c aslmap.c aslopcodes.c \ - asloperands.c aslpredef.c aslresource.c aslrestype1.c aslrestype2.c aslstartup.c \ - asltree.c aslutils.c asltransform.c aslfold.c aslstubs.c aslopt.c \ +SRCS= \ + aslcompilerparse.c \ + aslcompilerlex.c \ + aslanalyze.c \ + aslcodegen.c \ + aslcompile.c \ + aslerror.c \ + aslfiles.c \ + aslfold.c \ + asllength.c \ + asllisting.c \ + aslload.c \ + asllookup.c \ + aslmain.c \ + aslmap.c \ + aslopcodes.c \ + asloperands.c \ + aslopt.c \ + aslpredef.c \ + aslresource.c \ + aslrestype1.c \ + aslrestype1i.c \ + aslrestype2.c \ + aslrestype2d.c \ + aslrestype2e.c \ + aslrestype2q.c \ + aslrestype2w.c \ + aslstartup.c \ + aslstubs.c \ + asltransform.c \ + asltree.c \ + aslutils.c \ ../common/getopt.c \ ../utilities/utalloc.c \ ../utilities/utcache.c \ Modified: vendor-sys/acpica/dist/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcompile.c Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/compiler/aslcompile.c Wed Apr 28 21:50:57 2010 (r207340) @@ -177,7 +177,8 @@ AslCompilerSignon ( { Prefix = "; "; } - else if (Gbl_HexOutputFlag == HEX_OUTPUT_C) + else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) || + (Gbl_HexOutputFlag == HEX_OUTPUT_ASL)) { FlPrintFile (ASL_FILE_HEX_OUTPUT, "/*\n"); Prefix = " * "; @@ -265,7 +266,8 @@ AslCompilerFileHeader ( { Prefix = "; "; } - else if (Gbl_HexOutputFlag == HEX_OUTPUT_C) + else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) || + (Gbl_HexOutputFlag == HEX_OUTPUT_ASL)) { Prefix = " * "; } Modified: vendor-sys/acpica/dist/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcompiler.h Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/compiler/aslcompiler.h Wed Apr 28 21:50:57 2010 (r207340) @@ -592,6 +592,10 @@ FlFileError ( UINT32 FileId, UINT8 ErrorId); +UINT32 +FlGetFileSize ( + UINT32 FileId); + ACPI_STATUS FlReadFile ( UINT32 FileId, @@ -750,6 +754,34 @@ UtDoConstant ( /* * aslresource - Resource template generation utilities */ +void +RsSmallAddressCheck ( + UINT8 Type, + UINT32 Minimum, + UINT32 Maximum, + UINT32 Length, + UINT32 Alignment, + ACPI_PARSE_OBJECT *MinOp, + ACPI_PARSE_OBJECT *MaxOp, + ACPI_PARSE_OBJECT *LengthOp, + ACPI_PARSE_OBJECT *AlignOp); + +void +RsLargeAddressCheck ( + UINT64 Minimum, + UINT64 Maximum, + UINT64 Length, + UINT64 Granularity, + UINT8 Flags, + ACPI_PARSE_OBJECT *MinOp, + ACPI_PARSE_OBJECT *MaxOp, + ACPI_PARSE_OBJECT *LengthOp, + ACPI_PARSE_OBJECT *GranOp); + +UINT16 +RsGetStringDataLength ( + ACPI_PARSE_OBJECT *InitializerOp); + ASL_RESOURCE_NODE * RsAllocateResourceNode ( UINT32 Size); @@ -805,7 +837,7 @@ RsDoResourceTemplate ( /* - * aslrestype1 - generate Small descriptors + * aslrestype1 - Miscellaneous Small descriptors */ ASL_RESOURCE_NODE * RsDoEndTagDescriptor ( @@ -813,68 +845,72 @@ RsDoEndTagDescriptor ( UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoDmaDescriptor ( +RsDoEndDependentDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoEndDependentDescriptor ( +RsDoMemory24Descriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoFixedIoDescriptor ( +RsDoMemory32Descriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoIoDescriptor ( +RsDoMemory32FixedDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoIrqDescriptor ( +RsDoStartDependentDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoIrqNoFlagsDescriptor ( +RsDoStartDependentNoPriDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoMemory24Descriptor ( +RsDoVendorSmallDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); + +/* + * aslrestype1i - I/O-related Small descriptors + */ ASL_RESOURCE_NODE * -RsDoMemory32Descriptor ( +RsDoDmaDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoMemory32FixedDescriptor ( +RsDoFixedIoDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoStartDependentDescriptor ( +RsDoIoDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoStartDependentNoPriDescriptor ( +RsDoIrqDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoVendorSmallDescriptor ( +RsDoIrqNoFlagsDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); /* - * aslrestype2 - generate Large descriptors + * aslrestype2 - Large resource descriptors */ ASL_RESOURCE_NODE * RsDoInterruptDescriptor ( @@ -882,6 +918,20 @@ RsDoInterruptDescriptor ( UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * +RsDoVendorLargeDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset); + +ASL_RESOURCE_NODE * +RsDoGeneralRegisterDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset); + + +/* + * aslrestype2d - DWord address descriptors + */ +ASL_RESOURCE_NODE * RsDoDwordIoDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); @@ -896,6 +946,10 @@ RsDoDwordSpaceDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); + +/* + * aslrestype2e - Extended address descriptors + */ ASL_RESOURCE_NODE * RsDoExtendedIoDescriptor ( ACPI_PARSE_OBJECT *Op, @@ -911,6 +965,10 @@ RsDoExtendedSpaceDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); + +/* + * aslrestype2q - QWord address descriptors + */ ASL_RESOURCE_NODE * RsDoQwordIoDescriptor ( ACPI_PARSE_OBJECT *Op, @@ -926,6 +984,10 @@ RsDoQwordSpaceDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); + +/* + * aslrestype2w - Word address descriptors + */ ASL_RESOURCE_NODE * RsDoWordIoDescriptor ( ACPI_PARSE_OBJECT *Op, @@ -941,15 +1003,5 @@ RsDoWordBusNumberDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); -ASL_RESOURCE_NODE * -RsDoVendorLargeDescriptor ( - ACPI_PARSE_OBJECT *Op, - UINT32 CurrentByteOffset); - -ASL_RESOURCE_NODE * -RsDoGeneralRegisterDescriptor ( - ACPI_PARSE_OBJECT *Op, - UINT32 CurrentByteOffset); - #endif /* __ASLCOMPILER_H */ Modified: vendor-sys/acpica/dist/compiler/asldefine.h ============================================================================== --- vendor-sys/acpica/dist/compiler/asldefine.h Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/compiler/asldefine.h Wed Apr 28 21:50:57 2010 (r207340) @@ -128,7 +128,7 @@ #define CompilerId "ASL Optimizing Compiler" #define DisassemblerId "AML Disassembler" #define CompilerCopyright "Copyright (c) 2000 - 2010 Intel Corporation" -#define CompilerCompliance "Supports ACPI Specification Revision 4.0" +#define CompilerCompliance "Supports ACPI Specification Revision 4.0a" #define CompilerName "iasl" #define CompilerCreatorId "INTL" Modified: vendor-sys/acpica/dist/compiler/aslfiles.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslfiles.c Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/compiler/aslfiles.c Wed Apr 28 21:50:57 2010 (r207340) @@ -236,6 +236,36 @@ FlOpenFile ( /******************************************************************************* * + * FUNCTION: FlGetFileSize + * + * PARAMETERS: FileId - Index into file info array + * + * RETURN: File Size + * + * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open. + * + ******************************************************************************/ + +UINT32 +FlGetFileSize ( + UINT32 FileId) +{ + FILE *fp; + UINT32 FileSize; + + + fp = Gbl_Files[FileId].Handle; + + fseek (fp, 0, SEEK_END); + FileSize = (UINT32) ftell (fp); + fseek (fp, 0, SEEK_SET); + + return (FileSize); +} + + +/******************************************************************************* + * * FUNCTION: FlReadFile * * PARAMETERS: FileId - Index into file info array Modified: vendor-sys/acpica/dist/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/compiler/aslglobal.h Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/compiler/aslglobal.h Wed Apr 28 21:50:57 2010 (r207340) @@ -188,6 +188,7 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_FoldConstants, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseErrors, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoResourceChecking, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE); @@ -200,6 +201,8 @@ ASL_EXTERN UINT8 ASL_ #define HEX_OUTPUT_NONE 0 #define HEX_OUTPUT_C 1 #define HEX_OUTPUT_ASM 2 +#define HEX_OUTPUT_ASL 3 + ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HexOutputFlag, HEX_OUTPUT_NONE); Modified: vendor-sys/acpica/dist/compiler/asllisting.c ============================================================================== --- vendor-sys/acpica/dist/compiler/asllisting.c Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/compiler/asllisting.c Wed Apr 28 21:50:57 2010 (r207340) @@ -198,6 +198,10 @@ static void LsDoHexOutputAsm ( void); +static void +LsDoHexOutputAsl ( + void); + ACPI_STATUS LsTreeWriteWalk ( ACPI_PARSE_OBJECT *Op, @@ -1337,6 +1341,11 @@ LsDoHexOutput ( LsDoHexOutputAsm (); break; + case HEX_OUTPUT_ASL: + + LsDoHexOutputAsl (); + break; + default: /* No other output types supported */ break; @@ -1362,60 +1371,160 @@ static void LsDoHexOutputC ( void) { - UINT32 j; - UINT8 FileByte[HEX_TABLE_LINE_SIZE]; - UINT8 Buffer[4]; + UINT8 FileData[HEX_TABLE_LINE_SIZE]; + UINT32 LineLength; UINT32 Offset = 0; + UINT32 AmlFileSize; + UINT32 i; + + + /* Get AML size, seek back to start */ + AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT); - FlPrintFile (ASL_FILE_HEX_OUTPUT, " * C source code output\n *\n */\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " * C source code output\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n", + AmlFileSize); FlPrintFile (ASL_FILE_HEX_OUTPUT, "unsigned char AmlCode[] =\n{\n"); - /* Start at the beginning of the AML file */ + while (Offset < AmlFileSize) + { + /* Read enough bytes needed for one output line */ - FlSeekFile (ASL_FILE_AML_OUTPUT, 0); + LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, + Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); + if (!LineLength) + { + break; + } - /* Process all AML bytes in the AML file */ + FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); - j = 0; - while (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte[j], 1) == AE_OK) - { - if (j == 0) + for (i = 0; i < LineLength; i++) { - FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); + /* + * Print each hex byte. + * Add a comma until the very last byte of the AML file + * (Some C compilers complain about a trailing comma) + */ + FlPrintFile (ASL_FILE_HEX_OUTPUT, "0x%2.2X", FileData[i]); + if ((Offset + i + 1) < AmlFileSize) + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, ","); + } + else + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); + } } - /* Convert each AML byte to hex */ + /* Add fill spaces if needed for last line */ - UtConvertByteToHex (FileByte[j], Buffer); - FlWriteFile (ASL_FILE_HEX_OUTPUT, Buffer, 4); - FlPrintFile (ASL_FILE_HEX_OUTPUT, ","); + if (LineLength < HEX_TABLE_LINE_SIZE) + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s", + 5 * (HEX_TABLE_LINE_SIZE - LineLength), " "); + } - /* An occasional linefeed improves readability */ + /* Emit the offset and ascii dump for the entire line */ - Offset++; - j++; + FlPrintFile (ASL_FILE_HEX_OUTPUT, " /* %8.8X", Offset); + LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n", + HEX_TABLE_LINE_SIZE - LineLength + 1, " "); - if (j >= HEX_TABLE_LINE_SIZE) - { - /* End of line, emit the ascii dump of the entire line */ + Offset += LineLength; + } - FlPrintFile (ASL_FILE_HEX_OUTPUT, - " /* %8.8X", Offset - HEX_TABLE_LINE_SIZE); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "};\n"); + FlCloseFile (ASL_FILE_HEX_OUTPUT); +} - /* Write the ASCII character associated with each of the bytes */ - LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, - HEX_TABLE_LINE_SIZE, FileByte); - FlPrintFile (ASL_FILE_HEX_OUTPUT, " */\n"); +/******************************************************************************* + * + * FUNCTION: LsDoHexOutputAsl + * + * PARAMETERS: None + * + * RETURN: None. + * + * DESCRIPTION: Create the hex output file. This is the same data as the AML + * output file, but formatted into hex/ascii bytes suitable for + * inclusion into a C source file. + * + ******************************************************************************/ - /* Start new line */ +static void +LsDoHexOutputAsl ( + void) +{ + UINT8 FileData[HEX_TABLE_LINE_SIZE]; + UINT32 LineLength; + UINT32 Offset = 0; + UINT32 AmlFileSize; + UINT32 i; - j = 0; + + /* Get AML size, seek back to start */ + + AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT); + + FlPrintFile (ASL_FILE_HEX_OUTPUT, " * ASL source code output\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n", + AmlFileSize); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " Name (BUF1, Buffer()\n {\n"); + + while (Offset < AmlFileSize) + { + /* Read enough bytes needed for one output line */ + + LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, + Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); + if (!LineLength) + { + break; + } + + FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); + + for (i = 0; i < LineLength; i++) + { + /* + * Print each hex byte. + * Add a comma until the very last byte of the AML file + * (Some C compilers complain about a trailing comma) + */ + FlPrintFile (ASL_FILE_HEX_OUTPUT, "0x%2.2X", FileData[i]); + if ((Offset + i + 1) < AmlFileSize) + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, ","); + } + else + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); + } + } + + /* Add fill spaces if needed for last line */ + + if (LineLength < HEX_TABLE_LINE_SIZE) + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s", + 5 * (HEX_TABLE_LINE_SIZE - LineLength), " "); } + + /* Emit the offset and ascii dump for the entire line */ + + FlPrintFile (ASL_FILE_HEX_OUTPUT, " /* %8.8X", Offset); + LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n", + HEX_TABLE_LINE_SIZE - LineLength + 1, " "); + + Offset += LineLength; } - FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n};\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " })\n"); FlCloseFile (ASL_FILE_HEX_OUTPUT); } @@ -1438,58 +1547,64 @@ static void LsDoHexOutputAsm ( void) { - UINT32 j; - UINT8 FileByte[HEX_TABLE_LINE_SIZE]; - UINT8 Buffer[4]; + UINT8 FileData[HEX_TABLE_LINE_SIZE]; + UINT32 LineLength; UINT32 Offset = 0; - BOOLEAN DoComma = FALSE; + UINT32 AmlFileSize; + UINT32 i; - FlPrintFile (ASL_FILE_HEX_OUTPUT, "; Assembly code source output\n;\n"); + /* Get AML size, seek back to start */ - /* Start at the beginning of the AML file */ + AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT); - FlSeekFile (ASL_FILE_AML_OUTPUT, 0); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "; Assembly code source output\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "; AML code block contains 0x%X bytes\n;\n", + AmlFileSize); - /* Process all AML bytes in the AML file */ - - j = 0; - while (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte[j], 1) == AE_OK) + while (Offset < AmlFileSize) { - if (j == 0) + /* Read enough bytes needed for one output line */ + + LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, + Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); + if (!LineLength) { - FlPrintFile (ASL_FILE_HEX_OUTPUT, " db "); + break; } - else if (DoComma) + + FlPrintFile (ASL_FILE_HEX_OUTPUT, " db "); + + for (i = 0; i < LineLength; i++) { - FlPrintFile (ASL_FILE_HEX_OUTPUT, ","); - DoComma = FALSE; + /* + * Print each hex byte. + * Add a comma until the last byte of the line + */ + FlPrintFile (ASL_FILE_HEX_OUTPUT, "0%2.2Xh", FileData[i]); + if ((i + 1) < LineLength) + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, ","); + } } - /* Convert each AML byte to hex */ - - UtConvertByteToAsmHex (FileByte[j], Buffer); - FlWriteFile (ASL_FILE_HEX_OUTPUT, Buffer, 4); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); - /* An occasional linefeed improves readability */ + /* Add fill spaces if needed for last line */ - Offset++; - j++; - if (j >= HEX_TABLE_LINE_SIZE) + if (LineLength < HEX_TABLE_LINE_SIZE) { - FlPrintFile (ASL_FILE_HEX_OUTPUT, - " ;%8.8X", Offset - HEX_TABLE_LINE_SIZE); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s", + 5 * (HEX_TABLE_LINE_SIZE - LineLength), " "); + } - /* Write the ASCII character associated with each of the bytes */ + /* Emit the offset and ascii dump for the entire line */ - LsDumpAscii (ASL_FILE_HEX_OUTPUT, HEX_TABLE_LINE_SIZE, FileByte); - FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n"); - j = 0; - } - else - { - DoComma = TRUE; - } + FlPrintFile (ASL_FILE_HEX_OUTPUT, " ; %8.8X", Offset); + LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n"); + + Offset += LineLength; } FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n"); Modified: vendor-sys/acpica/dist/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslmain.c Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/compiler/aslmain.c Wed Apr 28 21:50:57 2010 (r207340) @@ -167,7 +167,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:2b:cd^e:fgh^i^I:l^o:p:r:s:t:v:w:x:" +#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:v:w:x:" /******************************************************************************* @@ -203,13 +203,14 @@ Options ( printf ("\nAML Output Files:\n"); printf (" -s Create AML in assembler or C source file (*.asm or *.c)\n"); printf (" -i Create assembler or C include file (*.inc or *.h)\n"); - printf (" -t Create AML in assembler or C hex table (*.hex)\n"); + printf (" -t Create AML in assembler, C, or ASL hex table (*.hex)\n"); printf ("\nAML Code Generation:\n"); printf (" -oa Disable all optimizations (compatibility mode)\n"); printf (" -of Disable constant folding\n"); printf (" -oi Disable integer optimization to Zero/One/Ones\n"); printf (" -on Disable named reference string optimization\n"); + printf (" -cr Disable Resource Descriptor error checking\n"); printf (" -r Override table header Revision (1-255)\n"); printf ("\nListings:\n"); @@ -264,7 +265,7 @@ HelpMessage ( printf (" -b Create compiler debug/trace file (*.txt)\n"); printf (" Types: Parse/Tree/Both\n"); printf (" -f Ignore errors, force creation of AML output file(s)\n"); - printf (" -c Parse only, no output generation\n"); + printf (" -n Parse only, no output generation\n"); printf (" -ot Display compile times\n"); printf (" -x Set debug level for trace output\n"); } @@ -507,10 +508,16 @@ AslDoOptions ( case 'c': + switch (AcpiGbl_Optarg[0]) + { + case 'r': + Gbl_NoResourceChecking = TRUE; + break; - /* Parse only */ - - Gbl_ParseOnlyFlag = TRUE; + default: + printf ("Unknown option: -c%s\n", AcpiGbl_Optarg); + return (-1); + } break; @@ -688,6 +695,14 @@ AslDoOptions ( break; + case 'n': + + /* Parse only */ + + Gbl_ParseOnlyFlag = TRUE; + break; + + case 'p': /* Override default AML output filename */ @@ -741,6 +756,10 @@ AslDoOptions ( Gbl_HexOutputFlag = HEX_OUTPUT_C; break; + case 's': + Gbl_HexOutputFlag = HEX_OUTPUT_ASL; + break; + default: printf ("Unknown option: -t%s\n", AcpiGbl_Optarg); return (-1); Modified: vendor-sys/acpica/dist/compiler/aslpredef.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslpredef.c Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/compiler/aslpredef.c Wed Apr 28 21:50:57 2010 (r207340) @@ -243,11 +243,11 @@ ApCheckForPredefinedMethod ( break; - case ACPI_EVENT_RESERVED_NAME: /* _Lxx, _Exx, and _Qxx methods */ + case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */ Gbl_ReservedMethods++; - /* NumArguments must be zero for all _Lxx, _Exx, and _Qxx methods */ + /* NumArguments must be zero for all _Lxx/_Exx/_Wxx/_Qxx methods */ if (MethodInfo->NumArguments != 0) { @@ -346,12 +346,12 @@ ApCheckPredefinedReturnValue ( case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */ case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */ case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */ - case ACPI_EVENT_RESERVED_NAME: /* _Lxx, _Exx, and _Qxx methods */ + case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */ /* Just return, nothing to do */ return; - default: /* a real predefined ACPI name */ + default: /* A standard predefined ACPI name */ /* Exit if no return value expected */ @@ -425,29 +425,59 @@ ApCheckForPredefinedObject ( * or a predefined scope name */ Index = ApCheckForPredefinedName (Op, Name); - if (Index > ACPI_VALID_RESERVED_NAME_MAX) + + switch (Index) { + case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */ + case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */ + case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */ + + /* Nothing to do */ return; - } - /* - * We found a matching predefind name. - * Check if this predefined name requires input arguments - */ - if (PredefinedNames[Index].Info.ParamCount > 0) - { + case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */ + /* - * This predefined name must always be defined as a control - * method because it is required to have input arguments. + * These names must be control methods, by definition in ACPI spec. + * Also because they are defined to return no value. None of them + * require any arguments. */ AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, - "with arguments"); - } + "with zero arguments"); + return; - /* Typecheck the actual object, it is the next argument */ + default: /* A standard predefined ACPI name */ - ApCheckObjectType (Op->Asl.Child->Asl.Next, - PredefinedNames[Index].Info.ExpectedBtypes); + /* + * If this predefined name requires input arguments, then + * it must be implemented as a control method + */ + if (PredefinedNames[Index].Info.ParamCount > 0) + { + AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, + "with arguments"); + return; + } + + /* + * If no return value is expected from this predefined name, then + * it follows that it must be implemented as a control method + * (with zero args, because the args > 0 case was handled above) + * Examples are: _DIS, _INI, _IRC, _OFF, _ON, _PSx + */ + if (!PredefinedNames[Index].Info.ExpectedBtypes) + { + AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, + "with zero arguments"); + return; + } + + /* Typecheck the actual object, it is the next argument */ + + ApCheckObjectType (Op->Asl.Child->Asl.Next, + PredefinedNames[Index].Info.ExpectedBtypes); + return; + } } @@ -514,7 +544,7 @@ ApCheckForPredefinedName ( } } - /* Check for _Lxx, _Exx, _Qxx, _T_x. Warning if unknown predefined name */ + /* Check for _Lxx/_Exx/_Wxx/_Qxx/_T_x. Warning if unknown predefined name */ return (ApCheckForSpecialName (Op, Name)); } @@ -530,7 +560,7 @@ ApCheckForPredefinedName ( * RETURN: None * * DESCRIPTION: Check for the "special" predefined names - - * _Lxx, _Exx, _Qxx, and _T_x + * _Lxx, _Exx, _Qxx, _Wxx, and _T_x * ******************************************************************************/ @@ -541,14 +571,16 @@ ApCheckForSpecialName ( { /* - * Check for the "special" predefined names. We know the first char is an - * underscore already. + * Check for the "special" predefined names. We already know that the + * first character is an underscore. * GPE: _Lxx * GPE: _Exx + * GPE: _Wxx * EC: _Qxx */ if ((Name[1] == 'L') || (Name[1] == 'E') || + (Name[1] == 'W') || (Name[1] == 'Q')) { /* The next two characters must be hex digits */ Modified: vendor-sys/acpica/dist/compiler/aslresource.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslresource.c Wed Apr 28 19:42:20 2010 (r207339) +++ vendor-sys/acpica/dist/compiler/aslresource.c Wed Apr 28 21:50:57 2010 (r207340) @@ -1,7 +1,7 @@ /****************************************************************************** * - * Module Name: aslresource - Resource templates and descriptors + * Module Name: aslresource - Resource template/descriptor utilities * *****************************************************************************/ @@ -126,6 +126,298 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 21:51:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25233106566C; Wed, 28 Apr 2010 21:51: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 EF0AB8FC17; Wed, 28 Apr 2010 21:51: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 o3SLprKp056487; Wed, 28 Apr 2010 21:51:53 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SLprfO056486; Wed, 28 Apr 2010 21:51:53 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201004282151.o3SLprfO056486@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 28 Apr 2010 21:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207341 - vendor-sys/acpica/20100428 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 21:51:54 -0000 Author: jkim Date: Wed Apr 28 21:51:53 2010 New Revision: 207341 URL: http://svn.freebsd.org/changeset/base/207341 Log: Tag ACPICA 20100428. Added: vendor-sys/acpica/20100428/ - copied from r207340, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 22:23:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A6F0106564A; Wed, 28 Apr 2010 22:23:30 +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 09C128FC0C; Wed, 28 Apr 2010 22:23: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 o3SMNTLF074222; Wed, 28 Apr 2010 22:23:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SMNTQ4074221; Wed, 28 Apr 2010 22:23:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004282223.o3SMNTQ4074221@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 28 Apr 2010 22:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207343 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 22:23:30 -0000 Author: pjd Date: Wed Apr 28 22:23:29 2010 New Revision: 207343 URL: http://svn.freebsd.org/changeset/base/207343 Log: Don't assume that "resource" property is in metadata. Reported by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/metadata.c Modified: head/sbin/hastd/metadata.c ============================================================================== --- head/sbin/hastd/metadata.c Wed Apr 28 22:06:22 2010 (r207342) +++ head/sbin/hastd/metadata.c Wed Apr 28 22:23:29 2010 (r207343) @@ -117,7 +117,7 @@ metadata_read(struct hast_resource *res, } str = nv_get_string(nv, "resource"); - if (strcmp(str, res->hr_name) != 0) { + if (str != NULL && strcmp(str, res->hr_name) != 0) { pjdlog_error("Provider %s is not part of resource %s.", res->hr_localpath, res->hr_name); nv_free(nv); From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 22:25:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79AB11065680; Wed, 28 Apr 2010 22:25:28 +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 64A2F8FC18; Wed, 28 Apr 2010 22:25:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3SMPSvv075895; Wed, 28 Apr 2010 22:25:28 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SMPSeR075875; Wed, 28 Apr 2010 22:25:28 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201004282225.o3SMPSeR075875@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 28 Apr 2010 22:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207344 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/events sys/contri... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Apr 2010 22:25:28 -0000 Author: jkim Date: Wed Apr 28 22:25:27 2010 New Revision: 207344 URL: http://svn.freebsd.org/changeset/base/207344 Log: Merge ACPICA 20100428. Added: head/sys/contrib/dev/acpica/compiler/aslrestype1i.c - copied, changed from r207340, vendor-sys/acpica/dist/compiler/aslrestype1i.c head/sys/contrib/dev/acpica/compiler/aslrestype2d.c - copied, changed from r207340, vendor-sys/acpica/dist/compiler/aslrestype2d.c head/sys/contrib/dev/acpica/compiler/aslrestype2e.c - copied, changed from r207340, vendor-sys/acpica/dist/compiler/aslrestype2e.c head/sys/contrib/dev/acpica/compiler/aslrestype2q.c - copied, changed from r207340, vendor-sys/acpica/dist/compiler/aslrestype2q.c head/sys/contrib/dev/acpica/compiler/aslrestype2w.c - copied, changed from r207340, vendor-sys/acpica/dist/compiler/aslrestype2w.c head/sys/contrib/dev/acpica/events/evgpeinit.c - copied, changed from r207340, vendor-sys/acpica/dist/events/evgpeinit.c head/sys/contrib/dev/acpica/events/evgpeutil.c - copied, changed from r207340, vendor-sys/acpica/dist/events/evgpeutil.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslrestype1.c head/sys/contrib/dev/acpica/compiler/aslrestype2.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/debugger/dbcmds.c head/sys/contrib/dev/acpica/debugger/dbdisply.c head/sys/contrib/dev/acpica/events/evgpe.c head/sys/contrib/dev/acpica/events/evgpeblk.c head/sys/contrib/dev/acpica/executer/exconfig.c head/sys/contrib/dev/acpica/executer/exoparg1.c head/sys/contrib/dev/acpica/executer/exsystem.c head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/acinterp.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/amlresrc.h head/sys/contrib/dev/acpica/osunixxf.c head/sys/contrib/dev/acpica/tables/tbfind.c head/sys/contrib/dev/acpica/tables/tbinstal.c head/sys/contrib/dev/acpica/tables/tbutils.c head/sys/contrib/dev/acpica/tables/tbxface.c head/sys/contrib/dev/acpica/utilities/utcopy.c head/sys/contrib/dev/acpica/utilities/utglobal.c head/sys/contrib/dev/acpica/utilities/uttrack.c head/sys/dev/acpica/Osd/OsdHardware.c head/sys/modules/acpi/acpi/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/ (props changed) head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/conf/files Wed Apr 28 22:25:27 2010 (r207344) @@ -174,6 +174,8 @@ contrib/dev/acpica/dispatcher/dswstate.c contrib/dev/acpica/events/evevent.c optional acpi contrib/dev/acpica/events/evgpe.c optional acpi contrib/dev/acpica/events/evgpeblk.c optional acpi +contrib/dev/acpica/events/evgpeinit.c optional acpi +contrib/dev/acpica/events/evgpeutil.c optional acpi contrib/dev/acpica/events/evmisc.c optional acpi contrib/dev/acpica/events/evregion.c optional acpi contrib/dev/acpica/events/evrgnini.c optional acpi Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Wed Apr 28 22:25:27 2010 (r207344) @@ -19,7 +19,7 @@ fulldirs="common compiler debugger disas tools utilities" # files to remove -stripdirs="acpisrc acpixtract examples generate os_specific" +stripdirs="acpisrc acpixtract examples generate os_specific tests" stripfiles="Makefile README acintel.h aclinux.h acmsvc.h acnetbsd.h \ acos2.h accygwin.h acefi.h acwin.h acwin64.h aeexec.c \ aehandlers.c aemain.c aetables.c osunixdir.c readme.txt \ Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/changes.txt Wed Apr 28 22:25:27 2010 (r207344) @@ -1,4 +1,70 @@ ---------------------------------------- +28 April 2010. Summary of changes for version 20100428: + +1) ACPI CA Core Subsystem: + +Implemented GPE support for dynamically loaded ACPI tables. For all GPEs, +including FADT-based and GPE Block Devices, execute any _PRW methods in the +new table, and process any _Lxx/_Exx GPE methods in the new table. Any +runtime GPE that is referenced by an _Lxx/_Exx method in the new table is +immediately enabled. Handles the FADT-defined GPEs as well as GPE Block +Devices. Provides compatibility with other ACPI implementations. Two new +files added, evgpeinit.c and evgpeutil.c. ACPICA BZ 833. Lin Ming, Bob Moore. + +Fixed a regression introduced in version 20100331 within the table manager +where initial table loading could fail. This was introduced in the fix for +AcpiReallocateRootTable. Also, renamed some of fields in the table manager +data structures to clarify their meaning and use. + +Fixed a possible allocation overrun during internal object copy in +AcpiUtCopySimpleObject. The original code did not correctly handle the case +where the object to be copied was a namespace node. Lin Ming. ACPICA BZ 847. + +Updated the allocation dump routine, AcpiUtDumpAllocation and fixed a +possible access beyond end-of-allocation. Also, now fully validate descriptor +(size and type) before output. Lin Ming, Bob Moore. ACPICA BZ 847 + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 87.9K Code, 18.6K Data, 106.5K Total + Debug Version: 163.5K Code, 51.3K Data, 214.8K Total + Current Release: + Non-Debug Version: 88.4K Code, 18.8K Data, 107.2K Total + Debug Version: 164.2K Code, 51.5K Data, 215.7K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented Min/Max/Len/Gran validation for address resource +descriptors. This change implements validation for the address fields that +are common to all address-type resource descriptors. These checks are +implemented: Checks for valid Min/Max, length within the Min/Max window, +valid granularity, Min/Max a multiple of granularity, and _MIF/_MAF as per +table 6-40 in the ACPI 4.0a specification. Also split the large aslrestype1.c +and aslrestype2.c files into five new files. ACPICA BZ 840. + +iASL: Added support for the _Wxx predefined names. This support was missing +and these names were not recognized by the compiler as valid predefined +names. ACPICA BZ 851. + +iASL: Added an error for all predefined names that are defined to return no +value and thus must be implemented as Control Methods. These include all of +the _Lxx, _Exx, _Wxx, and _Qxx names, as well as some other miscellaneous +names such as _DIS, _INI, _IRC, _OFF, _ON, and _PSx. ACPICA BZ 850, 856. + +iASL: Implemented the -ts option to emit hex AML data in ASL format, as an +ASL Buffer. Allows ACPI tables to be easily included within ASL files, to be +dynamically loaded via the Load() operator. Also cleaned up output for the - +ta and -tc options. ACPICA BZ 853. + +Tests: Added a new file with examples of extended iASL error checking. +Demonstrates the advanced error checking ability of the iASL compiler. +Available at tests/misc/badcode.asl. + +---------------------------------------- 31 March 2010. Summary of changes for version 20100331: 1) ACPI CA Core Subsystem: Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/common/adisasm.c Wed Apr 28 22:25:27 2010 (r207344) @@ -282,8 +282,8 @@ AdInitialize ( /* Setup the Table Manager (cheat - there is no RSDT) */ - AcpiGbl_RootTableList.Size = 1; - AcpiGbl_RootTableList.Count = 0; + AcpiGbl_RootTableList.MaxTableCount = 1; + AcpiGbl_RootTableList.CurrentTableCount = 0; AcpiGbl_RootTableList.Tables = LocalTables; return (Status); @@ -1156,7 +1156,7 @@ AdParseTable ( /* If LoadTable is FALSE, we are parsing the last loaded table */ - TableIndex = AcpiGbl_RootTableList.Count - 1; + TableIndex = AcpiGbl_RootTableList.CurrentTableCount - 1; /* Pass 2 */ Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Apr 28 22:25:27 2010 (r207344) @@ -177,7 +177,8 @@ AslCompilerSignon ( { Prefix = "; "; } - else if (Gbl_HexOutputFlag == HEX_OUTPUT_C) + else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) || + (Gbl_HexOutputFlag == HEX_OUTPUT_ASL)) { FlPrintFile (ASL_FILE_HEX_OUTPUT, "/*\n"); Prefix = " * "; @@ -265,7 +266,8 @@ AslCompilerFileHeader ( { Prefix = "; "; } - else if (Gbl_HexOutputFlag == HEX_OUTPUT_C) + else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) || + (Gbl_HexOutputFlag == HEX_OUTPUT_ASL)) { Prefix = " * "; } Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Apr 28 22:25:27 2010 (r207344) @@ -592,6 +592,10 @@ FlFileError ( UINT32 FileId, UINT8 ErrorId); +UINT32 +FlGetFileSize ( + UINT32 FileId); + ACPI_STATUS FlReadFile ( UINT32 FileId, @@ -750,6 +754,34 @@ UtDoConstant ( /* * aslresource - Resource template generation utilities */ +void +RsSmallAddressCheck ( + UINT8 Type, + UINT32 Minimum, + UINT32 Maximum, + UINT32 Length, + UINT32 Alignment, + ACPI_PARSE_OBJECT *MinOp, + ACPI_PARSE_OBJECT *MaxOp, + ACPI_PARSE_OBJECT *LengthOp, + ACPI_PARSE_OBJECT *AlignOp); + +void +RsLargeAddressCheck ( + UINT64 Minimum, + UINT64 Maximum, + UINT64 Length, + UINT64 Granularity, + UINT8 Flags, + ACPI_PARSE_OBJECT *MinOp, + ACPI_PARSE_OBJECT *MaxOp, + ACPI_PARSE_OBJECT *LengthOp, + ACPI_PARSE_OBJECT *GranOp); + +UINT16 +RsGetStringDataLength ( + ACPI_PARSE_OBJECT *InitializerOp); + ASL_RESOURCE_NODE * RsAllocateResourceNode ( UINT32 Size); @@ -805,7 +837,7 @@ RsDoResourceTemplate ( /* - * aslrestype1 - generate Small descriptors + * aslrestype1 - Miscellaneous Small descriptors */ ASL_RESOURCE_NODE * RsDoEndTagDescriptor ( @@ -813,68 +845,72 @@ RsDoEndTagDescriptor ( UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoDmaDescriptor ( +RsDoEndDependentDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoEndDependentDescriptor ( +RsDoMemory24Descriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoFixedIoDescriptor ( +RsDoMemory32Descriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoIoDescriptor ( +RsDoMemory32FixedDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoIrqDescriptor ( +RsDoStartDependentDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoIrqNoFlagsDescriptor ( +RsDoStartDependentNoPriDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoMemory24Descriptor ( +RsDoVendorSmallDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); + +/* + * aslrestype1i - I/O-related Small descriptors + */ ASL_RESOURCE_NODE * -RsDoMemory32Descriptor ( +RsDoDmaDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoMemory32FixedDescriptor ( +RsDoFixedIoDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoStartDependentDescriptor ( +RsDoIoDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoStartDependentNoPriDescriptor ( +RsDoIrqDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * -RsDoVendorSmallDescriptor ( +RsDoIrqNoFlagsDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); /* - * aslrestype2 - generate Large descriptors + * aslrestype2 - Large resource descriptors */ ASL_RESOURCE_NODE * RsDoInterruptDescriptor ( @@ -882,6 +918,20 @@ RsDoInterruptDescriptor ( UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * +RsDoVendorLargeDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset); + +ASL_RESOURCE_NODE * +RsDoGeneralRegisterDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset); + + +/* + * aslrestype2d - DWord address descriptors + */ +ASL_RESOURCE_NODE * RsDoDwordIoDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); @@ -896,6 +946,10 @@ RsDoDwordSpaceDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); + +/* + * aslrestype2e - Extended address descriptors + */ ASL_RESOURCE_NODE * RsDoExtendedIoDescriptor ( ACPI_PARSE_OBJECT *Op, @@ -911,6 +965,10 @@ RsDoExtendedSpaceDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); + +/* + * aslrestype2q - QWord address descriptors + */ ASL_RESOURCE_NODE * RsDoQwordIoDescriptor ( ACPI_PARSE_OBJECT *Op, @@ -926,6 +984,10 @@ RsDoQwordSpaceDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); + +/* + * aslrestype2w - Word address descriptors + */ ASL_RESOURCE_NODE * RsDoWordIoDescriptor ( ACPI_PARSE_OBJECT *Op, @@ -941,15 +1003,5 @@ RsDoWordBusNumberDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); -ASL_RESOURCE_NODE * -RsDoVendorLargeDescriptor ( - ACPI_PARSE_OBJECT *Op, - UINT32 CurrentByteOffset); - -ASL_RESOURCE_NODE * -RsDoGeneralRegisterDescriptor ( - ACPI_PARSE_OBJECT *Op, - UINT32 CurrentByteOffset); - #endif /* __ASLCOMPILER_H */ Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Wed Apr 28 22:25:27 2010 (r207344) @@ -128,7 +128,7 @@ #define CompilerId "ASL Optimizing Compiler" #define DisassemblerId "AML Disassembler" #define CompilerCopyright "Copyright (c) 2000 - 2010 Intel Corporation" -#define CompilerCompliance "Supports ACPI Specification Revision 4.0" +#define CompilerCompliance "Supports ACPI Specification Revision 4.0a" #define CompilerName "iasl" #define CompilerCreatorId "INTL" Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Apr 28 22:25:27 2010 (r207344) @@ -236,6 +236,36 @@ FlOpenFile ( /******************************************************************************* * + * FUNCTION: FlGetFileSize + * + * PARAMETERS: FileId - Index into file info array + * + * RETURN: File Size + * + * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open. + * + ******************************************************************************/ + +UINT32 +FlGetFileSize ( + UINT32 FileId) +{ + FILE *fp; + UINT32 FileSize; + + + fp = Gbl_Files[FileId].Handle; + + fseek (fp, 0, SEEK_END); + FileSize = (UINT32) ftell (fp); + fseek (fp, 0, SEEK_SET); + + return (FileSize); +} + + +/******************************************************************************* + * * FUNCTION: FlReadFile * * PARAMETERS: FileId - Index into file info array Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslglobal.h Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/compiler/aslglobal.h Wed Apr 28 22:25:27 2010 (r207344) @@ -188,6 +188,7 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_FoldConstants, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseErrors, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoResourceChecking, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE); @@ -200,6 +201,8 @@ ASL_EXTERN UINT8 ASL_ #define HEX_OUTPUT_NONE 0 #define HEX_OUTPUT_C 1 #define HEX_OUTPUT_ASM 2 +#define HEX_OUTPUT_ASL 3 + ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HexOutputFlag, HEX_OUTPUT_NONE); Modified: head/sys/contrib/dev/acpica/compiler/asllisting.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllisting.c Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/compiler/asllisting.c Wed Apr 28 22:25:27 2010 (r207344) @@ -198,6 +198,10 @@ static void LsDoHexOutputAsm ( void); +static void +LsDoHexOutputAsl ( + void); + ACPI_STATUS LsTreeWriteWalk ( ACPI_PARSE_OBJECT *Op, @@ -1337,6 +1341,11 @@ LsDoHexOutput ( LsDoHexOutputAsm (); break; + case HEX_OUTPUT_ASL: + + LsDoHexOutputAsl (); + break; + default: /* No other output types supported */ break; @@ -1362,60 +1371,160 @@ static void LsDoHexOutputC ( void) { - UINT32 j; - UINT8 FileByte[HEX_TABLE_LINE_SIZE]; - UINT8 Buffer[4]; + UINT8 FileData[HEX_TABLE_LINE_SIZE]; + UINT32 LineLength; UINT32 Offset = 0; + UINT32 AmlFileSize; + UINT32 i; + + + /* Get AML size, seek back to start */ + AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT); - FlPrintFile (ASL_FILE_HEX_OUTPUT, " * C source code output\n *\n */\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " * C source code output\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n", + AmlFileSize); FlPrintFile (ASL_FILE_HEX_OUTPUT, "unsigned char AmlCode[] =\n{\n"); - /* Start at the beginning of the AML file */ + while (Offset < AmlFileSize) + { + /* Read enough bytes needed for one output line */ - FlSeekFile (ASL_FILE_AML_OUTPUT, 0); + LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, + Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); + if (!LineLength) + { + break; + } - /* Process all AML bytes in the AML file */ + FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); - j = 0; - while (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte[j], 1) == AE_OK) - { - if (j == 0) + for (i = 0; i < LineLength; i++) { - FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); + /* + * Print each hex byte. + * Add a comma until the very last byte of the AML file + * (Some C compilers complain about a trailing comma) + */ + FlPrintFile (ASL_FILE_HEX_OUTPUT, "0x%2.2X", FileData[i]); + if ((Offset + i + 1) < AmlFileSize) + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, ","); + } + else + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); + } } - /* Convert each AML byte to hex */ + /* Add fill spaces if needed for last line */ - UtConvertByteToHex (FileByte[j], Buffer); - FlWriteFile (ASL_FILE_HEX_OUTPUT, Buffer, 4); - FlPrintFile (ASL_FILE_HEX_OUTPUT, ","); + if (LineLength < HEX_TABLE_LINE_SIZE) + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s", + 5 * (HEX_TABLE_LINE_SIZE - LineLength), " "); + } - /* An occasional linefeed improves readability */ + /* Emit the offset and ascii dump for the entire line */ - Offset++; - j++; + FlPrintFile (ASL_FILE_HEX_OUTPUT, " /* %8.8X", Offset); + LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n", + HEX_TABLE_LINE_SIZE - LineLength + 1, " "); - if (j >= HEX_TABLE_LINE_SIZE) - { - /* End of line, emit the ascii dump of the entire line */ + Offset += LineLength; + } - FlPrintFile (ASL_FILE_HEX_OUTPUT, - " /* %8.8X", Offset - HEX_TABLE_LINE_SIZE); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "};\n"); + FlCloseFile (ASL_FILE_HEX_OUTPUT); +} - /* Write the ASCII character associated with each of the bytes */ - LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, - HEX_TABLE_LINE_SIZE, FileByte); - FlPrintFile (ASL_FILE_HEX_OUTPUT, " */\n"); +/******************************************************************************* + * + * FUNCTION: LsDoHexOutputAsl + * + * PARAMETERS: None + * + * RETURN: None. + * + * DESCRIPTION: Create the hex output file. This is the same data as the AML + * output file, but formatted into hex/ascii bytes suitable for + * inclusion into a C source file. + * + ******************************************************************************/ - /* Start new line */ +static void +LsDoHexOutputAsl ( + void) +{ + UINT8 FileData[HEX_TABLE_LINE_SIZE]; + UINT32 LineLength; + UINT32 Offset = 0; + UINT32 AmlFileSize; + UINT32 i; - j = 0; + + /* Get AML size, seek back to start */ + + AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT); + + FlPrintFile (ASL_FILE_HEX_OUTPUT, " * ASL source code output\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n", + AmlFileSize); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " Name (BUF1, Buffer()\n {\n"); + + while (Offset < AmlFileSize) + { + /* Read enough bytes needed for one output line */ + + LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, + Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); + if (!LineLength) + { + break; + } + + FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); + + for (i = 0; i < LineLength; i++) + { + /* + * Print each hex byte. + * Add a comma until the very last byte of the AML file + * (Some C compilers complain about a trailing comma) + */ + FlPrintFile (ASL_FILE_HEX_OUTPUT, "0x%2.2X", FileData[i]); + if ((Offset + i + 1) < AmlFileSize) + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, ","); + } + else + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); + } + } + + /* Add fill spaces if needed for last line */ + + if (LineLength < HEX_TABLE_LINE_SIZE) + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s", + 5 * (HEX_TABLE_LINE_SIZE - LineLength), " "); } + + /* Emit the offset and ascii dump for the entire line */ + + FlPrintFile (ASL_FILE_HEX_OUTPUT, " /* %8.8X", Offset); + LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n", + HEX_TABLE_LINE_SIZE - LineLength + 1, " "); + + Offset += LineLength; } - FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n};\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " })\n"); FlCloseFile (ASL_FILE_HEX_OUTPUT); } @@ -1438,58 +1547,64 @@ static void LsDoHexOutputAsm ( void) { - UINT32 j; - UINT8 FileByte[HEX_TABLE_LINE_SIZE]; - UINT8 Buffer[4]; + UINT8 FileData[HEX_TABLE_LINE_SIZE]; + UINT32 LineLength; UINT32 Offset = 0; - BOOLEAN DoComma = FALSE; + UINT32 AmlFileSize; + UINT32 i; - FlPrintFile (ASL_FILE_HEX_OUTPUT, "; Assembly code source output\n;\n"); + /* Get AML size, seek back to start */ - /* Start at the beginning of the AML file */ + AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT); - FlSeekFile (ASL_FILE_AML_OUTPUT, 0); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "; Assembly code source output\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "; AML code block contains 0x%X bytes\n;\n", + AmlFileSize); - /* Process all AML bytes in the AML file */ - - j = 0; - while (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte[j], 1) == AE_OK) + while (Offset < AmlFileSize) { - if (j == 0) + /* Read enough bytes needed for one output line */ + + LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE, + Gbl_Files[ASL_FILE_AML_OUTPUT].Handle); + if (!LineLength) { - FlPrintFile (ASL_FILE_HEX_OUTPUT, " db "); + break; } - else if (DoComma) + + FlPrintFile (ASL_FILE_HEX_OUTPUT, " db "); + + for (i = 0; i < LineLength; i++) { - FlPrintFile (ASL_FILE_HEX_OUTPUT, ","); - DoComma = FALSE; + /* + * Print each hex byte. + * Add a comma until the last byte of the line + */ + FlPrintFile (ASL_FILE_HEX_OUTPUT, "0%2.2Xh", FileData[i]); + if ((i + 1) < LineLength) + { + FlPrintFile (ASL_FILE_HEX_OUTPUT, ","); + } } - /* Convert each AML byte to hex */ - - UtConvertByteToAsmHex (FileByte[j], Buffer); - FlWriteFile (ASL_FILE_HEX_OUTPUT, Buffer, 4); + FlPrintFile (ASL_FILE_HEX_OUTPUT, " "); - /* An occasional linefeed improves readability */ + /* Add fill spaces if needed for last line */ - Offset++; - j++; - if (j >= HEX_TABLE_LINE_SIZE) + if (LineLength < HEX_TABLE_LINE_SIZE) { - FlPrintFile (ASL_FILE_HEX_OUTPUT, - " ;%8.8X", Offset - HEX_TABLE_LINE_SIZE); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s", + 5 * (HEX_TABLE_LINE_SIZE - LineLength), " "); + } - /* Write the ASCII character associated with each of the bytes */ + /* Emit the offset and ascii dump for the entire line */ - LsDumpAscii (ASL_FILE_HEX_OUTPUT, HEX_TABLE_LINE_SIZE, FileByte); - FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n"); - j = 0; - } - else - { - DoComma = TRUE; - } + FlPrintFile (ASL_FILE_HEX_OUTPUT, " ; %8.8X", Offset); + LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n"); + + Offset += LineLength; } FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n"); Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Apr 28 22:25:27 2010 (r207344) @@ -167,7 +167,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:2b:cd^e:fgh^i^I:l^o:p:r:s:t:v:w:x:" +#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:v:w:x:" /******************************************************************************* @@ -203,13 +203,14 @@ Options ( printf ("\nAML Output Files:\n"); printf (" -s Create AML in assembler or C source file (*.asm or *.c)\n"); printf (" -i Create assembler or C include file (*.inc or *.h)\n"); - printf (" -t Create AML in assembler or C hex table (*.hex)\n"); + printf (" -t Create AML in assembler, C, or ASL hex table (*.hex)\n"); printf ("\nAML Code Generation:\n"); printf (" -oa Disable all optimizations (compatibility mode)\n"); printf (" -of Disable constant folding\n"); printf (" -oi Disable integer optimization to Zero/One/Ones\n"); printf (" -on Disable named reference string optimization\n"); + printf (" -cr Disable Resource Descriptor error checking\n"); printf (" -r Override table header Revision (1-255)\n"); printf ("\nListings:\n"); @@ -264,7 +265,7 @@ HelpMessage ( printf (" -b Create compiler debug/trace file (*.txt)\n"); printf (" Types: Parse/Tree/Both\n"); printf (" -f Ignore errors, force creation of AML output file(s)\n"); - printf (" -c Parse only, no output generation\n"); + printf (" -n Parse only, no output generation\n"); printf (" -ot Display compile times\n"); printf (" -x Set debug level for trace output\n"); } @@ -507,10 +508,16 @@ AslDoOptions ( case 'c': + switch (AcpiGbl_Optarg[0]) + { + case 'r': + Gbl_NoResourceChecking = TRUE; + break; - /* Parse only */ - - Gbl_ParseOnlyFlag = TRUE; + default: + printf ("Unknown option: -c%s\n", AcpiGbl_Optarg); + return (-1); + } break; @@ -688,6 +695,14 @@ AslDoOptions ( break; + case 'n': + + /* Parse only */ + + Gbl_ParseOnlyFlag = TRUE; + break; + + case 'p': /* Override default AML output filename */ @@ -741,6 +756,10 @@ AslDoOptions ( Gbl_HexOutputFlag = HEX_OUTPUT_C; break; + case 's': + Gbl_HexOutputFlag = HEX_OUTPUT_ASL; + break; + default: printf ("Unknown option: -t%s\n", AcpiGbl_Optarg); return (-1); Modified: head/sys/contrib/dev/acpica/compiler/aslpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpredef.c Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/compiler/aslpredef.c Wed Apr 28 22:25:27 2010 (r207344) @@ -243,11 +243,11 @@ ApCheckForPredefinedMethod ( break; - case ACPI_EVENT_RESERVED_NAME: /* _Lxx, _Exx, and _Qxx methods */ + case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */ Gbl_ReservedMethods++; - /* NumArguments must be zero for all _Lxx, _Exx, and _Qxx methods */ + /* NumArguments must be zero for all _Lxx/_Exx/_Wxx/_Qxx methods */ if (MethodInfo->NumArguments != 0) { @@ -346,12 +346,12 @@ ApCheckPredefinedReturnValue ( case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */ case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */ case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */ - case ACPI_EVENT_RESERVED_NAME: /* _Lxx, _Exx, and _Qxx methods */ + case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */ /* Just return, nothing to do */ return; - default: /* a real predefined ACPI name */ + default: /* A standard predefined ACPI name */ /* Exit if no return value expected */ @@ -425,29 +425,59 @@ ApCheckForPredefinedObject ( * or a predefined scope name */ Index = ApCheckForPredefinedName (Op, Name); - if (Index > ACPI_VALID_RESERVED_NAME_MAX) + + switch (Index) { + case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */ + case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */ + case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */ + + /* Nothing to do */ return; - } - /* - * We found a matching predefind name. - * Check if this predefined name requires input arguments - */ - if (PredefinedNames[Index].Info.ParamCount > 0) - { + case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */ + /* - * This predefined name must always be defined as a control - * method because it is required to have input arguments. + * These names must be control methods, by definition in ACPI spec. + * Also because they are defined to return no value. None of them + * require any arguments. */ AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, - "with arguments"); - } + "with zero arguments"); + return; - /* Typecheck the actual object, it is the next argument */ + default: /* A standard predefined ACPI name */ - ApCheckObjectType (Op->Asl.Child->Asl.Next, - PredefinedNames[Index].Info.ExpectedBtypes); + /* + * If this predefined name requires input arguments, then + * it must be implemented as a control method + */ + if (PredefinedNames[Index].Info.ParamCount > 0) + { + AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, + "with arguments"); + return; + } + + /* + * If no return value is expected from this predefined name, then + * it follows that it must be implemented as a control method + * (with zero args, because the args > 0 case was handled above) + * Examples are: _DIS, _INI, _IRC, _OFF, _ON, _PSx + */ + if (!PredefinedNames[Index].Info.ExpectedBtypes) + { + AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, + "with zero arguments"); + return; + } + + /* Typecheck the actual object, it is the next argument */ + + ApCheckObjectType (Op->Asl.Child->Asl.Next, + PredefinedNames[Index].Info.ExpectedBtypes); + return; + } } @@ -514,7 +544,7 @@ ApCheckForPredefinedName ( } } - /* Check for _Lxx, _Exx, _Qxx, _T_x. Warning if unknown predefined name */ + /* Check for _Lxx/_Exx/_Wxx/_Qxx/_T_x. Warning if unknown predefined name */ return (ApCheckForSpecialName (Op, Name)); } @@ -530,7 +560,7 @@ ApCheckForPredefinedName ( * RETURN: None * * DESCRIPTION: Check for the "special" predefined names - - * _Lxx, _Exx, _Qxx, and _T_x + * _Lxx, _Exx, _Qxx, _Wxx, and _T_x * ******************************************************************************/ @@ -541,14 +571,16 @@ ApCheckForSpecialName ( { /* - * Check for the "special" predefined names. We know the first char is an - * underscore already. + * Check for the "special" predefined names. We already know that the + * first character is an underscore. * GPE: _Lxx * GPE: _Exx + * GPE: _Wxx * EC: _Qxx */ if ((Name[1] == 'L') || (Name[1] == 'E') || + (Name[1] == 'W') || (Name[1] == 'Q')) { /* The next two characters must be hex digits */ Modified: head/sys/contrib/dev/acpica/compiler/aslresource.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslresource.c Wed Apr 28 22:23:29 2010 (r207343) +++ head/sys/contrib/dev/acpica/compiler/aslresource.c Wed Apr 28 22:25:27 2010 (r207344) @@ -1,7 +1,7 @@ /****************************************************************************** * - * Module Name: aslresource - Resource templates and descriptors + * Module Name: aslresource - Resource template/descriptor utilities * *****************************************************************************/ @@ -126,6 +126,298 @@ /******************************************************************************* * + * FUNCTION: RsSmallAddressCheck + * + * PARAMETERS: Minimum - Address Min value + * Maximum - Address Max value + * Length - Address range value + * Alignment - Address alignment value + * MinOp - Original Op for Address Min + * MaxOp - Original Op for Address Max + * LengthOp - Original Op for address range + * AlignOp - Original Op for address alignment. If + * NULL, means "zero value for alignment is + * OK, and means 64K alignment" (for + * Memory24 descriptor) + * + * RETURN: None. Adds error messages to error log if necessary + * + * DESCRIPTION: Perform common value checks for "small" address descriptors. + * Currently: + * Io, Memory24, Memory32 + * + ******************************************************************************/ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 22:26:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C437D1065688; Wed, 28 Apr 2010 22:26:30 +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 B3B1B8FC1B; Wed, 28 Apr 2010 22:26: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 o3SMQUIo076748; Wed, 28 Apr 2010 22:26:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SMQUUZ076746; Wed, 28 Apr 2010 22:26:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004282226.o3SMQUUZ076746@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 28 Apr 2010 22:26: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: r207345 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 22:26:30 -0000 Author: pjd Date: Wed Apr 28 22:26:30 2010 New Revision: 207345 URL: http://svn.freebsd.org/changeset/base/207345 Log: Use WEXITSTATUS() to obtain real exit code. MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Wed Apr 28 22:25:27 2010 (r207344) +++ head/sbin/hastd/hastd.c Wed Apr 28 22:26:30 2010 (r207345) @@ -294,9 +294,10 @@ listen_accept(void) "Waiting for worker process (pid=%u) failed", (unsigned int)res->hr_workerpid); /* See above. */ - } else if (status != 0) { + } else if (WEXITSTATUS(status) != 0) { pjdlog_error("Worker process (pid=%u) exited ungracefully: status=%d.", - (unsigned int)res->hr_workerpid, status); + (unsigned int)res->hr_workerpid, + WEXITSTATUS(status)); /* See above. */ } else { pjdlog_debug(1, From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 22:29:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 362F81065672; Wed, 28 Apr 2010 22:29:18 +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 0C1038FC15; Wed, 28 Apr 2010 22:29: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 o3SMTHX3079258; Wed, 28 Apr 2010 22:29:17 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SMTHhI079256; Wed, 28 Apr 2010 22:29:17 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201004282229.o3SMTHhI079256@svn.freebsd.org> From: Doug Barton Date: Wed, 28 Apr 2010 22:29: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: r207346 - 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: Wed, 28 Apr 2010 22:29:18 -0000 Author: dougb Date: Wed Apr 28 22:29:17 2010 New Revision: 207346 URL: http://svn.freebsd.org/changeset/base/207346 Log: In the case where named_chroot_autoupdate is NOT set, but named_chrootdir IS set, named-checkconf fails because it cannot find the conf file. Fix this by making checkconf a variable that includes "-t $named_chrootdir" as needed. Notice of the bug and suggested direction for the fix from [1]. Using required_files for named.conf is overkill ever since I added the named-checkconf call, so rather than update the logic to handle the case described above, remove it. This also handles the case where named_chroot_autoupdate IS set but the symlink doesn't exist yet. PR: conf/145904 Submitted by: J R Matthews Modified: head/etc/rc.d/named Modified: head/etc/rc.d/named ============================================================================== --- head/etc/rc.d/named Wed Apr 28 22:26:30 2010 (r207345) +++ head/etc/rc.d/named Wed Apr 28 22:29:17 2010 (r207346) @@ -192,6 +192,13 @@ named_prestart() $confgen_command fi + local checkconf + + checkconf="${command%/named}/named-checkconf" + if ! checkyesno named_chroot_autoupdate && [ -n "$named_chrootdir" ]; then + checkconf="$checkconf -t $named_chrootdir" + fi + # Create a forwarder configuration based on /etc/resolv.conf if checkyesno named_auto_forward; then if [ ! -s /etc/resolv.conf ]; then @@ -201,7 +208,7 @@ named_prestart() [ -s "${named_confdir}/auto_forward.conf" ] && create_file ${named_confdir}/auto_forward.conf - ${command%/named}/named-checkconf $named_conf || + $checkconf $named_conf || err 3 'named-checkconf for $named_conf failed' return fi @@ -263,8 +270,7 @@ named_prestart() create_file ${named_confdir}/auto_forward.conf fi - ${command%/named}/named-checkconf $named_conf || - err 3 'named-checkconf for $named_conf failed' + $checkconf $named_conf || err 3 'named-checkconf for $named_conf failed' } load_rc_config $name @@ -272,7 +278,7 @@ load_rc_config $name # Updating the following variables requires that rc.conf be loaded first # required_dirs="$named_chrootdir" # if it is set, it must exist -required_files="${named_conf:=/etc/namedb/named.conf}" + pidfile="${named_pidfile:-/var/run/named/pid}" named_confdir="${named_chrootdir}${named_conf%/*}" From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 22:39:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52EF8106566B; Wed, 28 Apr 2010 22:39:48 +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 422D48FC15; Wed, 28 Apr 2010 22:39:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3SMdmLl088532; Wed, 28 Apr 2010 22:39:48 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SMdmNt088530; Wed, 28 Apr 2010 22:39:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004282239.o3SMdmNt088530@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 28 Apr 2010 22:39: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: r207347 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 22:39:48 -0000 Author: pjd Date: Wed Apr 28 22:39:47 2010 New Revision: 207347 URL: http://svn.freebsd.org/changeset/base/207347 Log: Mark temporary issues as such. MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Wed Apr 28 22:29:17 2010 (r207346) +++ head/sbin/hastd/primary.c Wed Apr 28 22:39:47 2010 (r207347) @@ -480,7 +480,7 @@ init_remote(struct hast_resource *res, s /* Prepare outgoing connection with remote node. */ if (proto_client(res->hr_remoteaddr, &out) < 0) { - primary_exit(EX_OSERR, "Unable to create connection to %s", + primary_exit(EX_TEMPFAIL, "Unable to create connection to %s", res->hr_remoteaddr); } /* Try to connect, but accept failure. */ @@ -739,7 +739,7 @@ hastd_primary(struct hast_resource *res) pid = fork(); if (pid < 0) { KEEP_ERRNO((void)pidfile_remove(pfh)); - primary_exit(EX_OSERR, "Unable to fork"); + primary_exit(EX_TEMPFAIL, "Unable to fork"); } if (pid > 0) { From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 22:41:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA3581065674; Wed, 28 Apr 2010 22:41:06 +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 B9C5F8FC14; Wed, 28 Apr 2010 22:41: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 o3SMf6or089783; Wed, 28 Apr 2010 22:41:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SMf6Ao089781; Wed, 28 Apr 2010 22:41:06 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004282241.o3SMf6Ao089781@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 28 Apr 2010 22:41: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: r207348 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 22:41:06 -0000 Author: pjd Date: Wed Apr 28 22:41:06 2010 New Revision: 207348 URL: http://svn.freebsd.org/changeset/base/207348 Log: Restart worker thread only if the problem was temporary. In case of persistent problem we don't want to loop forever. MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Wed Apr 28 22:39:47 2010 (r207347) +++ head/sbin/hastd/hastd.c Wed Apr 28 22:41:06 2010 (r207348) @@ -140,9 +140,15 @@ child_exit(void) proto_close(res->hr_ctrl); res->hr_workerpid = 0; if (res->hr_role == HAST_ROLE_PRIMARY) { - sleep(1); - pjdlog_info("Restarting worker process."); - hastd_primary(res); + if (WEXITSTATUS(status) == EX_TEMPFAIL) { + sleep(1); + pjdlog_info("Restarting worker process."); + hastd_primary(res); + } else { + res->hr_role = HAST_ROLE_INIT; + pjdlog_info("Changing resource role back to %s.", + role2str(res->hr_role)); + } } pjdlog_prefix_set("%s", ""); } From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 23:05:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0631106566B; Wed, 28 Apr 2010 23:05:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FB4B8FC1E; Wed, 28 Apr 2010 23:05: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 o3SN5gVf012608; Wed, 28 Apr 2010 23:05:42 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SN5gGh012604; Wed, 28 Apr 2010 23:05:42 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201004282305.o3SN5gGh012604@svn.freebsd.org> From: Rick Macklem Date: Wed, 28 Apr 2010 23:05: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: r207349 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 23:05:42 -0000 Author: rmacklem Date: Wed Apr 28 23:05:42 2010 New Revision: 207349 URL: http://svn.freebsd.org/changeset/base/207349 Log: Delete a diagnostic statement that is no longer useful from the experimental NFS client. MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Wed Apr 28 22:41:06 2010 (r207348) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Wed Apr 28 23:05:42 2010 (r207349) @@ -1399,10 +1399,6 @@ nfsrpc_write(vnode_t vp, struct uio *uio else error = nfsrpc_writerpc(vp, uiop, iomode, verfp, newcred, &stateid, p, nap, attrflagp, stuff); -if (error == NFSERR_BADSTATEID) { -printf("st=0x%x 0x%x 0x%x\n",stateid.other[0],stateid.other[1],stateid.other[2]); -nfscl_dumpstate(nmp, 1, 1, 0, 0); -} if (error == NFSERR_STALESTATEID) nfscl_initiate_recovery(nmp->nm_clp); if (lckp != NULL) From owner-svn-src-all@FreeBSD.ORG Wed Apr 28 23:16:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EA87106564A; Wed, 28 Apr 2010 23:16:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF858FC0C; Wed, 28 Apr 2010 23:16:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3SNGL6F022583; Wed, 28 Apr 2010 23:16:21 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3SNGL2b022581; Wed, 28 Apr 2010 23:16:21 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201004282316.o3SNGL2b022581@svn.freebsd.org> From: Rick Macklem Date: Wed, 28 Apr 2010 23:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207350 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 23:16:21 -0000 Author: rmacklem Date: Wed Apr 28 23:16:21 2010 New Revision: 207350 URL: http://svn.freebsd.org/changeset/base/207350 Log: For the experimental NFS client, it should always flush dirty buffers before closing the NFSv4 opens, as the comment states. This patch deletes the call to nfscl_mustflush() which would return 0 for the case where a delegation still exists, which was incorrect and could cause crashes during recovery from an expired lease. MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clnode.c Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Wed Apr 28 23:05:42 2010 (r207349) +++ head/sys/fs/nfsclient/nfs_clnode.c Wed Apr 28 23:16:21 2010 (r207350) @@ -198,8 +198,7 @@ ncl_inactive(struct vop_inactive_args *a * must be flushed before the close, so that the stateid is * available for the writes. */ - if (nfscl_mustflush(vp)) - (void) ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1, 0); + (void) ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1, 0); (void) nfsrpc_close(vp, 1, ap->a_td); } From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 00:28:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B0AD106564A; Thu, 29 Apr 2010 00:28:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E52548FC0A; Thu, 29 Apr 2010 00:28: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 o3T0SYLi087613; Thu, 29 Apr 2010 00:28:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3T0SY5o087609; Thu, 29 Apr 2010 00:28:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004290028.o3T0SY5o087609@svn.freebsd.org> From: Xin LI Date: Thu, 29 Apr 2010 00:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207351 - stable/8/usr.sbin/mailwrapper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 00:28:35 -0000 Author: delphij Date: Thu Apr 29 00:28:34 2010 New Revision: 207351 URL: http://svn.freebsd.org/changeset/base/207351 Log: MFC r205938: Sync with OpenBSD: - avoid coredump when there's only one token on a line; - Use calloc(); - Remove a line inherited from example mdoc. Obtained from: OpenBSD Modified: stable/8/usr.sbin/mailwrapper/mailwrapper.8 stable/8/usr.sbin/mailwrapper/mailwrapper.c Directory Properties: stable/8/usr.sbin/mailwrapper/ (props changed) Modified: stable/8/usr.sbin/mailwrapper/mailwrapper.8 ============================================================================== --- stable/8/usr.sbin/mailwrapper/mailwrapper.8 Wed Apr 28 23:16:21 2010 (r207350) +++ stable/8/usr.sbin/mailwrapper/mailwrapper.8 Thu Apr 29 00:28:34 2010 (r207351) @@ -1,5 +1,5 @@ +.\" $OpenBSD: mailwrapper.8,v 1.10 2009/02/07 16:58:23 martynas Exp $ .\" $NetBSD: mailwrapper.8,v 1.11 2002/02/08 01:38:50 ross Exp $ -.\" $OpenBSD: mailwrapper.8,v 1.8 2003/06/12 12:59:51 jmc Exp $ .\" $FreeBSD$ .\" .\" Copyright (c) 1998 @@ -31,7 +31,6 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" The following requests are required for all man pages. .Dd August 7, 2006 .Dt MAILWRAPPER 8 .Os Modified: stable/8/usr.sbin/mailwrapper/mailwrapper.c ============================================================================== --- stable/8/usr.sbin/mailwrapper/mailwrapper.c Wed Apr 28 23:16:21 2010 (r207350) +++ stable/8/usr.sbin/mailwrapper/mailwrapper.c Thu Apr 29 00:28:34 2010 (r207351) @@ -1,4 +1,4 @@ -/* $OpenBSD: mailwrapper.c,v 1.16 2004/07/06 03:38:14 millert Exp $ */ +/* $OpenBSD: mailwrapper.c,v 1.18 2007/11/06 14:39:19 otto Exp $ */ /* $NetBSD: mailwrapper.c,v 1.9 2003/03/09 08:10:43 mjl Exp $ */ /* @@ -61,8 +61,8 @@ initarg(struct arglist *al) { al->argc = 0; al->maxc = 10; - if ((al->argv = malloc(al->maxc * sizeof(char *))) == NULL) - err(EX_TEMPFAIL, "malloc"); + if ((al->argv = calloc(al->maxc, sizeof(char *))) == NULL) + err(EX_TEMPFAIL, "calloc"); } static void @@ -126,7 +126,7 @@ main(int argc, char *argv[], char *envp[ continue; } - if ((from = strsep(&cp, WS)) == NULL) + if ((from = strsep(&cp, WS)) == NULL || cp == NULL) goto parse_error; cp += strspn(cp, WS); From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 00:38:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FDA6106564A; Thu, 29 Apr 2010 00:38: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 E9E8C8FC12; Thu, 29 Apr 2010 00:38: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 o3T0cFda095815; Thu, 29 Apr 2010 00:38:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3T0cFfI095812; Thu, 29 Apr 2010 00:38:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004290038.o3T0cFfI095812@svn.freebsd.org> From: Xin LI Date: Thu, 29 Apr 2010 00:38:15 +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: r207352 - stable/7/usr.sbin/mailwrapper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 00:38:16 -0000 Author: delphij Date: Thu Apr 29 00:38:15 2010 New Revision: 207352 URL: http://svn.freebsd.org/changeset/base/207352 Log: MFC r205938: Sync with OpenBSD: - avoid coredump when there's only one token on a line; - Use calloc(); - Remove a line inherited from example mdoc. Obtained from: OpenBSD Modified: stable/7/usr.sbin/mailwrapper/mailwrapper.8 stable/7/usr.sbin/mailwrapper/mailwrapper.c Directory Properties: stable/7/usr.sbin/mailwrapper/ (props changed) Modified: stable/7/usr.sbin/mailwrapper/mailwrapper.8 ============================================================================== --- stable/7/usr.sbin/mailwrapper/mailwrapper.8 Thu Apr 29 00:28:34 2010 (r207351) +++ stable/7/usr.sbin/mailwrapper/mailwrapper.8 Thu Apr 29 00:38:15 2010 (r207352) @@ -1,5 +1,5 @@ +.\" $OpenBSD: mailwrapper.8,v 1.10 2009/02/07 16:58:23 martynas Exp $ .\" $NetBSD: mailwrapper.8,v 1.11 2002/02/08 01:38:50 ross Exp $ -.\" $OpenBSD: mailwrapper.8,v 1.8 2003/06/12 12:59:51 jmc Exp $ .\" $FreeBSD$ .\" .\" Copyright (c) 1998 @@ -31,7 +31,6 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" The following requests are required for all man pages. .Dd August 7, 2006 .Dt MAILWRAPPER 8 .Os Modified: stable/7/usr.sbin/mailwrapper/mailwrapper.c ============================================================================== --- stable/7/usr.sbin/mailwrapper/mailwrapper.c Thu Apr 29 00:28:34 2010 (r207351) +++ stable/7/usr.sbin/mailwrapper/mailwrapper.c Thu Apr 29 00:38:15 2010 (r207352) @@ -1,4 +1,4 @@ -/* $OpenBSD: mailwrapper.c,v 1.16 2004/07/06 03:38:14 millert Exp $ */ +/* $OpenBSD: mailwrapper.c,v 1.18 2007/11/06 14:39:19 otto Exp $ */ /* $NetBSD: mailwrapper.c,v 1.9 2003/03/09 08:10:43 mjl Exp $ */ /* @@ -61,8 +61,8 @@ initarg(struct arglist *al) { al->argc = 0; al->maxc = 10; - if ((al->argv = malloc(al->maxc * sizeof(char *))) == NULL) - err(EX_TEMPFAIL, "malloc"); + if ((al->argv = calloc(al->maxc, sizeof(char *))) == NULL) + err(EX_TEMPFAIL, "calloc"); } static void @@ -126,7 +126,7 @@ main(int argc, char *argv[], char *envp[ continue; } - if ((from = strsep(&cp, WS)) == NULL) + if ((from = strsep(&cp, WS)) == NULL || cp == NULL) goto parse_error; cp += strspn(cp, WS); From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 05:45:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA9FC1065670; Thu, 29 Apr 2010 05:45:47 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 285498FC15; Thu, 29 Apr 2010 05:45:45 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA28021; Thu, 29 Apr 2010 08:45:43 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1O7MZD-0008Au-4p; Thu, 29 Apr 2010 08:45:43 +0300 Message-ID: <4BD91D05.3090806@freebsd.org> Date: Thu, 29 Apr 2010 08:45:41 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100321) MIME-Version: 1.0 To: Jung-uk Kim References: <201004281726.o3SHQ6xN095645@svn.freebsd.org> In-Reply-To: <201004281726.o3SHQ6xN095645@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Roman Divacky Subject: Re: svn commit: r207330 - head/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 05:45:47 -0000 on 28/04/2010 20:26 Jung-uk Kim said the following: > Author: jkim > Date: Wed Apr 28 17:26:05 2010 > New Revision: 207330 > URL: http://svn.freebsd.org/changeset/base/207330 > > Log: > Remove dead code. Calculated greatest common divisor was not used at all. > On top of that, LLVM+Clang mis-compiles this code because of its register > allocator bug. > > Analyzed by: Andrew Reilly (areilly at bigpond dot net dot au) > Reviewed by: ariff, rdivacky > MFC after: 3 days I think that we also owe an attribution to Alexander Best , who discovered the problem, reported it and did an immense job of narrowing it down to a single function. > Modified: > head/sys/dev/sound/pcm/buffer.c > > Modified: head/sys/dev/sound/pcm/buffer.c > ============================================================================== > --- head/sys/dev/sound/pcm/buffer.c Wed Apr 28 15:38:01 2010 (r207329) > +++ head/sys/dev/sound/pcm/buffer.c Wed Apr 28 17:26:05 2010 (r207330) > @@ -568,7 +568,6 @@ sndbuf_updateprevtotal(struct snd_dbuf * > unsigned int > snd_xbytes(unsigned int v, unsigned int from, unsigned int to) > { > - unsigned int w, x, y; > > if (from == to) > return v; > @@ -576,16 +575,6 @@ snd_xbytes(unsigned int v, unsigned int > if (from == 0 || to == 0 || v == 0) > return 0; > > - x = from; > - y = to; > - while (y != 0) { > - w = x % y; > - x = y; > - y = w; > - } > - from /= x; > - to /= x; > - > return (unsigned int)(((u_int64_t)v * to) / from); > } > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 06:16:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3239106566B; Thu, 29 Apr 2010 06:16:00 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91A028FC0A; Thu, 29 Apr 2010 06:16: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 o3T6G0dX005034; Thu, 29 Apr 2010 06:16:00 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3T6G0Is005029; Thu, 29 Apr 2010 06:16:00 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201004290616.o3T6G0Is005029@svn.freebsd.org> From: Maxim Sobolev Date: Thu, 29 Apr 2010 06:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207354 - head/sys/dev/atkbdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 06:16:00 -0000 Author: sobomax Date: Thu Apr 29 06:16:00 2010 New Revision: 207354 URL: http://svn.freebsd.org/changeset/base/207354 Log: On certain chipsets AT keyboard controller isn't present and is emulated by BIOS using SMI interrupt. On those chipsets reading from the status port may be thousand times slower than usually. Sometimes this emilation is not working properly resulting in commands timing out and since we assume that inb() operation takes very little time to complete we need to adjust number of retries to keep waiting time within a designed limits (100ms). Measure time it takes to make read_status() call and adjust number of retries accordingly. To keep it simple, use TSC to measure inb() performance and keep it to amd64-only, since TSC may not available on older CPUs. Also enable detection of the AT controller absence on amd64. Reviewed by: jhb MFC after: 1 month Modified: head/sys/dev/atkbdc/atkbdc.c head/sys/dev/atkbdc/atkbdc_ebus.c head/sys/dev/atkbdc/atkbdc_isa.c head/sys/dev/atkbdc/atkbdcreg.h Modified: head/sys/dev/atkbdc/atkbdc.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc.c Thu Apr 29 05:55:38 2010 (r207353) +++ head/sys/dev/atkbdc/atkbdc.c Thu Apr 29 06:16:00 2010 (r207354) @@ -44,6 +44,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(__amd64__) +#include +#endif + #include #ifdef __sparc64__ @@ -153,7 +157,7 @@ atkbdc_configure(void) bus_space_tag_t tag; bus_space_handle_t h0; bus_space_handle_t h1; -#if defined(__i386__) +#if defined(__i386__) || defined(__amd64__) volatile int i; register_t flags; #endif @@ -222,7 +226,7 @@ atkbdc_configure(void) #endif #endif -#if defined(__i386__) +#if defined(__i386__) || defined(__amd64__) /* * Check if we really have AT keyboard controller. Poll status * register until we get "all clear" indication. If no such @@ -248,6 +252,11 @@ static int atkbdc_setup(atkbdc_softc_t *sc, bus_space_tag_t tag, bus_space_handle_t h0, bus_space_handle_t h1) { +#if defined(__amd64__) + u_int64_t tscval[3], read_delay; + register_t flags; +#endif + if (sc->ioh0 == 0) { /* XXX */ sc->command_byte = -1; sc->command_mask = 0; @@ -264,6 +273,33 @@ atkbdc_setup(atkbdc_softc_t *sc, bus_spa sc->iot = tag; sc->ioh0 = h0; sc->ioh1 = h1; + +#if defined(__amd64__) + /* + * On certain chipsets AT keyboard controller isn't present and is + * emulated by BIOS using SMI interrupt. On those chipsets reading + * from the status port may be thousand times slower than usually. + * Sometimes this emilation is not working properly resulting in + * commands timing our and since we assume that inb() operation + * takes very little time to complete we need to adjust number of + * retries to keep waiting time within a designed limits (100ms). + * Measure time it takes to make read_status() call and adjust + * number of retries accordingly. + */ + flags = intr_disable(); + tscval[0] = rdtsc(); + read_status(sc); + tscval[1] = rdtsc(); + DELAY(1000); + tscval[2] = rdtsc(); + intr_restore(flags); + read_delay = tscval[1] - tscval[0]; + read_delay /= (tscval[2] - tscval[1]) / 1000; + sc->retry = 100000 / ((KBDD_DELAYTIME * 2) + read_delay); +#else + sc->retry = 5000; +#endif + return 0; } @@ -380,10 +416,12 @@ removeq(kqueue *q) static int wait_while_controller_busy(struct atkbdc_softc *kbdc) { - /* CPU will stay inside the loop for 100msec at most */ - int retry = 5000; + int retry; int f; + /* CPU will stay inside the loop for 100msec at most */ + retry = kbdc->retry; + while ((f = read_status(kbdc)) & KBDS_INPUT_BUFFER_FULL) { if ((f & KBDS_BUFFER_FULL) == KBDS_KBD_BUFFER_FULL) { DELAY(KBDD_DELAYTIME); @@ -406,10 +444,12 @@ wait_while_controller_busy(struct atkbdc static int wait_for_data(struct atkbdc_softc *kbdc) { - /* CPU will stay inside the loop for 200msec at most */ - int retry = 10000; + int retry; int f; + /* CPU will stay inside the loop for 200msec at most */ + retry = kbdc->retry * 2; + while ((f = read_status(kbdc) & KBDS_ANY_BUFFER_FULL) == 0) { DELAY(KBDC_DELAYTIME); if (--retry < 0) @@ -423,10 +463,12 @@ wait_for_data(struct atkbdc_softc *kbdc) static int wait_for_kbd_data(struct atkbdc_softc *kbdc) { - /* CPU will stay inside the loop for 200msec at most */ - int retry = 10000; + int retry; int f; + /* CPU will stay inside the loop for 200msec at most */ + retry = kbdc->retry * 2; + while ((f = read_status(kbdc) & KBDS_BUFFER_FULL) != KBDS_KBD_BUFFER_FULL) { if (f == KBDS_AUX_BUFFER_FULL) { @@ -448,11 +490,13 @@ wait_for_kbd_data(struct atkbdc_softc *k static int wait_for_kbd_ack(struct atkbdc_softc *kbdc) { - /* CPU will stay inside the loop for 200msec at most */ - int retry = 10000; + int retry; int f; int b; + /* CPU will stay inside the loop for 200msec at most */ + retry = kbdc->retry * 2; + while (retry-- > 0) { if ((f = read_status(kbdc)) & KBDS_ANY_BUFFER_FULL) { DELAY(KBDD_DELAYTIME); @@ -475,10 +519,12 @@ wait_for_kbd_ack(struct atkbdc_softc *kb static int wait_for_aux_data(struct atkbdc_softc *kbdc) { - /* CPU will stay inside the loop for 200msec at most */ - int retry = 10000; + int retry; int f; + /* CPU will stay inside the loop for 200msec at most */ + retry = kbdc->retry * 2; + while ((f = read_status(kbdc) & KBDS_BUFFER_FULL) != KBDS_AUX_BUFFER_FULL) { if (f == KBDS_KBD_BUFFER_FULL) { @@ -500,11 +546,13 @@ wait_for_aux_data(struct atkbdc_softc *k static int wait_for_aux_ack(struct atkbdc_softc *kbdc) { - /* CPU will stay inside the loop for 200msec at most */ - int retry = 10000; + int retry; int f; int b; + /* CPU will stay inside the loop for 200msec at most */ + retry = kbdc->retry * 2; + while (retry-- > 0) { if ((f = read_status(kbdc)) & KBDS_ANY_BUFFER_FULL) { DELAY(KBDD_DELAYTIME); Modified: head/sys/dev/atkbdc/atkbdc_ebus.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc_ebus.c Thu Apr 29 05:55:38 2010 (r207353) +++ head/sys/dev/atkbdc/atkbdc_ebus.c Thu Apr 29 06:16:00 2010 (r207354) @@ -202,6 +202,7 @@ atkbdc_ebus_attach(device_t dev) "cannot determine command/data port resource\n"); return (ENXIO); } + sc->retry = 5000; sc->port0 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, start, 1, RF_ACTIVE); if (sc->port0 == NULL) { Modified: head/sys/dev/atkbdc/atkbdc_isa.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc_isa.c Thu Apr 29 05:55:38 2010 (r207353) +++ head/sys/dev/atkbdc/atkbdc_isa.c Thu Apr 29 06:16:00 2010 (r207354) @@ -94,7 +94,7 @@ atkbdc_isa_probe(device_t dev) u_long count; int error; int rid; -#if defined(__i386__) +#if defined(__i386__) || defined(__amd64__) bus_space_tag_t tag; bus_space_handle_t ioh1; volatile int i; @@ -141,7 +141,7 @@ atkbdc_isa_probe(device_t dev) return ENXIO; } -#if defined(__i386__) +#if defined(__i386__) || defined(__amd64__) /* * Check if we really have AT keyboard controller. Poll status * register until we get "all clear" indication. If no such @@ -161,6 +161,8 @@ atkbdc_isa_probe(device_t dev) if (i == 65535) { bus_release_resource(dev, SYS_RES_IOPORT, 0, port0); bus_release_resource(dev, SYS_RES_IOPORT, 1, port1); + if (bootverbose) + device_printf(dev, "AT keyboard controller not found\n"); return ENXIO; } #endif @@ -201,6 +203,7 @@ atkbdc_isa_attach(device_t dev) } rid = 0; + sc->retry = 5000; sc->port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (sc->port0 == NULL) Modified: head/sys/dev/atkbdc/atkbdcreg.h ============================================================================== --- head/sys/dev/atkbdc/atkbdcreg.h Thu Apr 29 05:55:38 2010 (r207353) +++ head/sys/dev/atkbdc/atkbdcreg.h Thu Apr 29 06:16:00 2010 (r207354) @@ -200,6 +200,7 @@ typedef struct atkbdc_softc { int lock; /* FIXME: XXX not quite a semaphore... */ kqueue kbd; /* keyboard data queue */ kqueue aux; /* auxiliary data queue */ + int retry; } atkbdc_softc_t; enum kbdc_device_ivar { From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 06:22:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94411106566B; Thu, 29 Apr 2010 06:22:07 +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 8364E8FC08; Thu, 29 Apr 2010 06:22: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 o3T6M7Cp010918; Thu, 29 Apr 2010 06:22:07 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3T6M7cn010916; Thu, 29 Apr 2010 06:22:07 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201004290622.o3T6M7cn010916@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 29 Apr 2010 06:22: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: r207355 - head/sys/pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 06:22:07 -0000 Author: nyan Date: Thu Apr 29 06:22:07 2010 New Revision: 207355 URL: http://svn.freebsd.org/changeset/base/207355 Log: MFi386: revision 206553 - Change printf() calls to uprintf() for sigreturn(). - Normalize the messages to include both pid and thread name. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Thu Apr 29 06:16:00 2010 (r207354) +++ head/sys/pc98/pc98/machdep.c Thu Apr 29 06:22:07 2010 (r207355) @@ -874,7 +874,8 @@ freebsd4_sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) { - printf("freebsd4_sigreturn: eflags = 0x%x\n", eflags); + uprintf("pid %d (%s): freebsd4_sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); return (EINVAL); } @@ -885,7 +886,8 @@ freebsd4_sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("freebsd4_sigreturn: cs = 0x%x\n", cs); + uprintf("pid %d (%s): freebsd4_sigreturn cs = 0x%x\n", + td->td_proc->p_pid, td->td_name, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; @@ -986,7 +988,8 @@ sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) { - printf("sigreturn: eflags = 0x%x\n", eflags); + uprintf("pid %d (%s): sigreturn eflags = 0x%x\n", + td->td_proc->p_pid, td->td_name, eflags); return (EINVAL); } @@ -997,7 +1000,8 @@ sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("sigreturn: cs = 0x%x\n", cs); + uprintf("pid %d (%s): sigreturn cs = 0x%x\n", + td->td_proc->p_pid, td->td_name, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 09:02:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFE511065673; Thu, 29 Apr 2010 09:02:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 964578FC1A; Thu, 29 Apr 2010 09:02:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3T92LcZ060881; Thu, 29 Apr 2010 09:02:21 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3T92Llv060878; Thu, 29 Apr 2010 09:02:21 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004290902.o3T92Llv060878@svn.freebsd.org> From: Andriy Gapon Date: Thu, 29 Apr 2010 09:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207359 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 09:02:21 -0000 Author: avg Date: Thu Apr 29 09:02:21 2010 New Revision: 207359 URL: http://svn.freebsd.org/changeset/base/207359 Log: kern_ntptime: abstract time error check into a function ... to avoid code duplication MFC after: 1 week Modified: head/sys/kern/kern_ntptime.c Modified: head/sys/kern/kern_ntptime.c ============================================================================== --- head/sys/kern/kern_ntptime.c Thu Apr 29 07:23:13 2010 (r207358) +++ head/sys/kern/kern_ntptime.c Thu Apr 29 09:02:21 2010 (r207359) @@ -198,22 +198,11 @@ static long pps_errcnt; /* calibration static void ntp_init(void); static void hardupdate(long offset); static void ntp_gettime1(struct ntptimeval *ntvp); +static int ntp_is_time_error(void); -static void -ntp_gettime1(struct ntptimeval *ntvp) +static int +ntp_is_time_error(void) { - struct timespec atv; /* nanosecond time */ - - GIANT_REQUIRED; - - nanotime(&atv); - ntvp->time.tv_sec = atv.tv_sec; - ntvp->time.tv_nsec = atv.tv_nsec; - ntvp->maxerror = time_maxerror; - ntvp->esterror = time_esterror; - ntvp->tai = time_tai; - ntvp->time_state = time_state; - /* * Status word error decode. If any of these conditions occur, * an error is returned, instead of the status word. Most @@ -243,6 +232,27 @@ ntp_gettime1(struct ntptimeval *ntvp) */ (time_status & STA_PPSFREQ && time_status & (STA_PPSWANDER | STA_PPSERROR))) + return (1); + + return (0); +} + +static void +ntp_gettime1(struct ntptimeval *ntvp) +{ + struct timespec atv; /* nanosecond time */ + + GIANT_REQUIRED; + + nanotime(&atv); + ntvp->time.tv_sec = atv.tv_sec; + ntvp->time.tv_nsec = atv.tv_nsec; + ntvp->maxerror = time_maxerror; + ntvp->esterror = time_esterror; + ntvp->tai = time_tai; + ntvp->time_state = time_state; + + if (ntp_is_time_error()) ntvp->time_state = TIME_ERROR; } @@ -446,17 +456,11 @@ ntp_adjtime(struct thread *td, struct nt * Status word error decode. See comments in * ntp_gettime() routine. */ - if ((time_status & (STA_UNSYNC | STA_CLOCKERR)) || - (time_status & (STA_PPSFREQ | STA_PPSTIME) && - !(time_status & STA_PPSSIGNAL)) || - (time_status & STA_PPSTIME && - time_status & STA_PPSJITTER) || - (time_status & STA_PPSFREQ && - time_status & (STA_PPSWANDER | STA_PPSERROR))) { + if (ntp_is_time_error()) td->td_retval[0] = TIME_ERROR; - } else { + else td->td_retval[0] = time_state; - } + done2: mtx_unlock(&Giant); return (error); From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 09:02:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4E1E1065670; Thu, 29 Apr 2010 09:02:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94CFF8FC17; Thu, 29 Apr 2010 09:02: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 o3T92kSU061307; Thu, 29 Apr 2010 09:02:46 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3T92kDW061305; Thu, 29 Apr 2010 09:02:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004290902.o3T92kDW061305@svn.freebsd.org> From: Andriy Gapon Date: Thu, 29 Apr 2010 09:02: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: r207360 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 09:02:46 -0000 Author: avg Date: Thu Apr 29 09:02:46 2010 New Revision: 207360 URL: http://svn.freebsd.org/changeset/base/207360 Log: periodically save system time to hardware time-of-day clock This is done in kern_ntptime, perhaps not the best place. This is done using resettodr(). Some features: - make save period configurable via tunable and sysctl - period of zero disables saving, setting a non-zero period re-enables it or reschedules it - do saving only if system clock is ntp-synchronized - save on shutdown Discussed with: des, Peter Jeremy X-Maybe: save time near seconds boundary for better precision MFC after: 2 weeks Modified: head/sys/kern/kern_ntptime.c Modified: head/sys/kern/kern_ntptime.c ============================================================================== --- head/sys/kern/kern_ntptime.c Thu Apr 29 09:02:21 2010 (r207359) +++ head/sys/kern/kern_ntptime.c Thu Apr 29 09:02:46 2010 (r207360) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -976,3 +977,67 @@ kern_adjtime(struct thread *td, struct t return (0); } +static struct callout resettodr_callout; +static int resettodr_period = 1800; + +static void +periodic_resettodr(void *arg __unused) +{ + + if (!ntp_is_time_error()) { + mtx_lock(&Giant); + resettodr(); + mtx_unlock(&Giant); + } + if (resettodr_period > 0) + callout_schedule(&resettodr_callout, resettodr_period * hz); +} + +static void +shutdown_resettodr(void *arg __unused, int howto __unused) +{ + + callout_drain(&resettodr_callout); + if (resettodr_period > 0 && !ntp_is_time_error()) { + mtx_lock(&Giant); + resettodr(); + mtx_unlock(&Giant); + } +} + +static int +sysctl_resettodr_period(SYSCTL_HANDLER_ARGS) +{ + int error; + + error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); + if (error || !req->newptr) + return (error); + if (resettodr_period == 0) + callout_stop(&resettodr_callout); + else + callout_reset(&resettodr_callout, resettodr_period * hz, + periodic_resettodr, NULL); + return (0); +} + +SYSCTL_PROC(_machdep, OID_AUTO, rtc_save_period, CTLTYPE_INT|CTLFLAG_RW, + &resettodr_period, 1800, sysctl_resettodr_period, "I", + "Save system time to RTC with this period (in seconds)"); +TUNABLE_INT("machdep.rtc_save_period", &resettodr_period); + +static void +start_periodic_resettodr(void *arg __unused) +{ + + EVENTHANDLER_REGISTER(shutdown_pre_sync, shutdown_resettodr, NULL, + SHUTDOWN_PRI_FIRST); + callout_init(&resettodr_callout, 1); + if (resettodr_period == 0) + return; + callout_reset(&resettodr_callout, resettodr_period * hz, + periodic_resettodr, NULL); +} + +SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY - 1, + start_periodic_resettodr, NULL); From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 09:18:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63D891065672; Thu, 29 Apr 2010 09:18:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53F5E8FC2B; Thu, 29 Apr 2010 09:18: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 o3T9IaNc076613; Thu, 29 Apr 2010 09:18:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3T9IaIG076611; Thu, 29 Apr 2010 09:18:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004290918.o3T9IaIG076611@svn.freebsd.org> From: Andriy Gapon Date: Thu, 29 Apr 2010 09:18: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: r207362 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 09:18:37 -0000 Author: avg Date: Thu Apr 29 09:18:36 2010 New Revision: 207362 URL: http://svn.freebsd.org/changeset/base/207362 Log: kern_ntptime: drop a comment that became stale after r207359 MFC after: 1 week X-MFC after: r207359 Modified: head/sys/kern/kern_ntptime.c Modified: head/sys/kern/kern_ntptime.c ============================================================================== --- head/sys/kern/kern_ntptime.c Thu Apr 29 09:16:04 2010 (r207361) +++ head/sys/kern/kern_ntptime.c Thu Apr 29 09:18:36 2010 (r207362) @@ -453,10 +453,6 @@ ntp_adjtime(struct thread *td, struct nt if (error) goto done2; - /* - * Status word error decode. See comments in - * ntp_gettime() routine. - */ if (ntp_is_time_error()) td->td_retval[0] = TIME_ERROR; else From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 09:55:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BCE31065703; Thu, 29 Apr 2010 09:55: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 EF98B8FC17; Thu, 29 Apr 2010 09:55: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 o3T9tp1U012490; Thu, 29 Apr 2010 09:55:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3T9tpFt012486; Thu, 29 Apr 2010 09:55:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004290955.o3T9tpFt012486@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 29 Apr 2010 09:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207363 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 09:55:52 -0000 Author: kib Date: Thu Apr 29 09:55:51 2010 New Revision: 207363 URL: http://svn.freebsd.org/changeset/base/207363 Log: Remove caddr_t casts. Requested by: bde MFC after: 10 days Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Apr 29 09:18:36 2010 (r207362) +++ head/sys/kern/kern_proc.c Thu Apr 29 09:55:51 2010 (r207363) @@ -1084,11 +1084,9 @@ sysctl_out_proc_copyout(struct kinfo_pro if (req->flags & SCTL_MASK32) { freebsd32_kinfo_proc_out(ki, &ki32); - error = SYSCTL_OUT(req, (caddr_t)&ki32, - sizeof(struct kinfo_proc32)); + error = SYSCTL_OUT(req, &ki32, sizeof(struct kinfo_proc32)); } else - error = SYSCTL_OUT(req, (caddr_t)ki, - sizeof(struct kinfo_proc)); + error = SYSCTL_OUT(req, ki, sizeof(struct kinfo_proc)); return (error); } #else @@ -1096,7 +1094,7 @@ static int sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req) { - return (SYSCTL_OUT(req, (caddr_t)ki, sizeof(struct kinfo_proc))); + return (SYSCTL_OUT(req, ki, sizeof(struct kinfo_proc))); } #endif From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 09:57:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D39E5106566B; Thu, 29 Apr 2010 09:57: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 C3AC18FC15; Thu, 29 Apr 2010 09:57: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 o3T9vPuB014002; Thu, 29 Apr 2010 09:57:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3T9vPBR014000; Thu, 29 Apr 2010 09:57:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004290957.o3T9vPBR014000@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 29 Apr 2010 09:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207364 - 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: Thu, 29 Apr 2010 09:57:25 -0000 Author: kib Date: Thu Apr 29 09:57:25 2010 New Revision: 207364 URL: http://svn.freebsd.org/changeset/base/207364 Log: In swap pager, do not free the non-requested pages from the run if they are wired. Kstack pages are wired, this change prepares swap pager for handling of long runs of kstack pages. Noted and reviewed by: alc Tested by: pho MFC after: 2 weeks Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Thu Apr 29 09:55:51 2010 (r207363) +++ head/sys/vm/swap_pager.c Thu Apr 29 09:57:25 2010 (r207364) @@ -378,6 +378,14 @@ static void swp_pager_meta_free(vm_objec static void swp_pager_meta_free_all(vm_object_t); static daddr_t swp_pager_meta_ctl(vm_object_t, vm_pindex_t, int); +static void +swp_pager_free_nrpage(vm_page_t m) +{ + + if (m->wire_count == 0) + vm_page_free(m); +} + /* * SWP_SIZECHECK() - update swap_pager_full indication * @@ -1131,9 +1139,9 @@ swap_pager_getpages(vm_object_t object, vm_page_lock_queues(); for (k = 0; k < i; ++k) - vm_page_free(m[k]); + swp_pager_free_nrpage(m[k]); for (k = j; k < count; ++k) - vm_page_free(m[k]); + swp_pager_free_nrpage(m[k]); vm_page_unlock_queues(); } @@ -1529,7 +1537,7 @@ swp_pager_async_iodone(struct buf *bp) */ m->valid = 0; if (i != bp->b_pager.pg_reqpage) - vm_page_free(m); + swp_pager_free_nrpage(m); else vm_page_flash(m); /* From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 09:59:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B9CD106566B; Thu, 29 Apr 2010 09:59:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42BDB8FC0A; Thu, 29 Apr 2010 09:59:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3T9xH51015749; Thu, 29 Apr 2010 09:59:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3T9xH7Z015747; Thu, 29 Apr 2010 09:59:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004290959.o3T9xH7Z015747@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 29 Apr 2010 09:59: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: r207365 - 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: Thu, 29 Apr 2010 09:59:17 -0000 Author: kib Date: Thu Apr 29 09:59:16 2010 New Revision: 207365 URL: http://svn.freebsd.org/changeset/base/207365 Log: When doing kstack swapin, read as much pages in one run as possible. Suggested and reviewed by: alc (previous version) Tested by: pho MFC after: 2 weeks Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Thu Apr 29 09:57:25 2010 (r207364) +++ head/sys/vm/vm_glue.c Thu Apr 29 09:59:16 2010 (r207365) @@ -538,23 +538,37 @@ static void vm_thread_swapin(struct thread *td) { vm_object_t ksobj; - vm_page_t m, ma[KSTACK_MAX_PAGES]; - int i, pages, rv; + vm_page_t ma[KSTACK_MAX_PAGES]; + int i, j, k, pages, rv; pages = td->td_kstack_pages; ksobj = td->td_kstack_obj; VM_OBJECT_LOCK(ksobj); - for (i = 0; i < pages; i++) { - m = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY | + for (i = 0; i < pages; i++) + ma[i] = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED); - if (m->valid != VM_PAGE_BITS_ALL) { - rv = vm_pager_get_pages(ksobj, &m, 1, 0); + for (i = 0; i < pages; i++) { + if (ma[i]->valid != VM_PAGE_BITS_ALL) { + KASSERT(ma[i]->oflags & VPO_BUSY, + ("lost busy 1")); + vm_object_pip_add(ksobj, 1); + for (j = i + 1; j < pages; j++) { + KASSERT(ma[j]->valid == VM_PAGE_BITS_ALL || + (ma[j]->oflags & VPO_BUSY), + ("lost busy 2")); + if (ma[j]->valid == VM_PAGE_BITS_ALL) + break; + } + rv = vm_pager_get_pages(ksobj, ma + i, j - i, 0); if (rv != VM_PAGER_OK) - panic("vm_thread_swapin: cannot get kstack for proc: %d", td->td_proc->p_pid); - m = vm_page_lookup(ksobj, i); - } - ma[i] = m; - vm_page_wakeup(m); + panic("vm_thread_swapin: cannot get kstack for proc: %d", + td->td_proc->p_pid); + vm_object_pip_wakeup(ksobj); + for (k = i; k < j; k++) + ma[k] = vm_page_lookup(ksobj, k); + vm_page_wakeup(ma[i]); + } else if (ma[i]->oflags & VPO_BUSY) + vm_page_wakeup(ma[i]); } VM_OBJECT_UNLOCK(ksobj); pmap_qenter(td->td_kstack, ma, pages); From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 10:04:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E519E1065672; Thu, 29 Apr 2010 10:04:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4DB48FC14; Thu, 29 Apr 2010 10:04: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 o3TA40iw020279; Thu, 29 Apr 2010 10:04:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TA404C020277; Thu, 29 Apr 2010 10:04:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004291004.o3TA404C020277@svn.freebsd.org> From: Andriy Gapon Date: Thu, 29 Apr 2010 10:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207366 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 10:04:01 -0000 Author: avg Date: Thu Apr 29 10:04:00 2010 New Revision: 207366 URL: http://svn.freebsd.org/changeset/base/207366 Log: ffs_vfsops: restore alphabetic order of options in ffs_opts The order was not correct only for nfsv4acls. ("no" prefix is ignored) MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Thu Apr 29 09:59:16 2010 (r207365) +++ head/sys/ufs/ffs/ffs_vfsops.c Thu Apr 29 10:04:00 2010 (r207366) @@ -126,8 +126,8 @@ static struct buf_ops ffs_ops = { static const char *ffs_opts[] = { "acls", "async", "noatime", "noclusterr", "noclusterw", "noexec", "export", "force", "from", "multilabel", - "snapshot", "nosuid", "suiddir", "nosymfollow", "sync", - "union", "nfsv4acls", NULL }; + "nfsv4acls", "snapshot", "nosuid", "suiddir", "nosymfollow", "sync", + "union", NULL }; static int ffs_mount(struct mount *mp) From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 11:52:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED0C01065674; Thu, 29 Apr 2010 11:52:42 +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 D9E668FC21; Thu, 29 Apr 2010 11:52: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 o3TBqgba024884; Thu, 29 Apr 2010 11:52:42 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TBqgiG024856; Thu, 29 Apr 2010 11:52:42 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004291152.o3TBqgiG024856@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 29 Apr 2010 11:52: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: r207369 - in head/sys: contrib/ipfilter/netinet net netinet netinet6 netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 11:52:43 -0000 Author: bz Date: Thu Apr 29 11:52:42 2010 New Revision: 207369 URL: http://svn.freebsd.org/changeset/base/207369 Log: MFP4: @176978-176982, 176984, 176990-176994, 177441 "Whitspace" churn after the VIMAGE/VNET whirls. Remove the need for some "init" functions within the network stack, like pim6_init(), icmp_init() or significantly shorten others like ip6_init() and nd6_init(), using static initialization again where possible and formerly missed. Move (most) variables back to the place they used to be before the container structs and VIMAGE_GLOABLS (before r185088) and try to reduce the diff to stable/7 and earlier as good as possible, to help out-of-tree consumers to update from 6.x or 7.x to 8 or 9. This also removes some header file pollution for putatively static global variables. Revert VIMAGE specific changes in ipfilter::ip_auth.c, that are no longer needed. Reviewed by: jhb Discussed with: rwatson Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH MFC after: 6 days Modified: head/sys/contrib/ipfilter/netinet/ip_auth.c head/sys/net/if.c head/sys/net/if_gif.c head/sys/net/if_gif.h head/sys/net/route.c head/sys/netinet/icmp6.h head/sys/netinet/if_ether.c head/sys/netinet/in.c head/sys/netinet/in_gif.c head/sys/netinet/in_proto.c head/sys/netinet/in_rmx.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_icmp.h head/sys/netinet/ip_input.c head/sys/netinet/ip_var.h head/sys/netinet/tcp_hostcache.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_var.h head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/frag6.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6_gif.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_src.c head/sys/netinet6/in6_var.h head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/ip6_var.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/scope6.c head/sys/netipsec/ah_var.h head/sys/netipsec/esp_var.h head/sys/netipsec/ipcomp_var.h head/sys/netipsec/ipip_var.h head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec6.h head/sys/netipsec/key.c head/sys/netipsec/xform_esp.c Modified: head/sys/contrib/ipfilter/netinet/ip_auth.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_auth.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/contrib/ipfilter/netinet/ip_auth.c Thu Apr 29 11:52:42 2010 (r207369) @@ -70,11 +70,6 @@ struct file; #include #include #include -#if !defined(_KERNEL) && defined(__FreeBSD_version) && \ - __FreeBSD_version >= 800049 -# define V_ip_do_randomid ip_do_randomid -# define V_ip_id ip_id -#endif #if !defined(_KERNEL) && !defined(__osf__) && !defined(__sgi) # define KERNEL # define _KERNEL Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/net/if.c Thu Apr 29 11:52:42 2010 (r207369) @@ -163,9 +163,11 @@ static void if_detach_internal(struct if extern void nd6_setmtu(struct ifnet *); #endif +VNET_DEFINE(int, if_index); +int ifqmaxlen = IFQ_MAXLEN; VNET_DEFINE(struct ifnethead, ifnet); /* depend on static init XXX */ VNET_DEFINE(struct ifgrouphead, ifg_head); -VNET_DEFINE(int, if_index); + static VNET_DEFINE(int, if_indexlim) = 8; /* Table of ifnet by index. */ @@ -174,8 +176,6 @@ static VNET_DEFINE(struct ifindex_entry #define V_if_indexlim VNET(if_indexlim) #define V_ifindex_table VNET(ifindex_table) -int ifqmaxlen = IFQ_MAXLEN; - /* * The global network interface list (V_ifnet) and related state (such as * if_index, if_indexlim, and ifindex_table) are protected by an sxlock and Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/net/if_gif.c Thu Apr 29 11:52:42 2010 (r207369) @@ -94,20 +94,9 @@ */ static struct mtx gif_mtx; static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface"); - static VNET_DEFINE(LIST_HEAD(, gif_softc), gif_softc_list); - #define V_gif_softc_list VNET(gif_softc_list) -#ifdef INET -VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL; -#define V_ip_gif_ttl VNET(ip_gif_ttl) -#endif -#ifdef INET6 -VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM; -#define V_ip6_gif_hlim VNET(ip6_gif_hlim) -#endif - void (*ng_gif_input_p)(struct ifnet *ifp, struct mbuf **mp, int af); void (*ng_gif_input_orphan_p)(struct ifnet *ifp, struct mbuf *m, int af); void (*ng_gif_attach_p)(struct ifnet *ifp); @@ -135,19 +124,11 @@ SYSCTL_NODE(_net_link, IFT_GIF, gif, CTL */ #define MAX_GIF_NEST 1 #endif - static VNET_DEFINE(int, max_gif_nesting) = MAX_GIF_NEST; #define V_max_gif_nesting VNET(max_gif_nesting) - SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_RW, &VNET_NAME(max_gif_nesting), 0, "Max nested tunnels"); -#ifdef INET6 -SYSCTL_DECL(_net_inet6_ip6); -SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, CTLFLAG_RW, - &VNET_NAME(ip6_gif_hlim), 0, ""); -#endif - /* * By default, we disallow creation of multiple tunnels between the same * pair of addresses. Some applications require this functionality so @@ -159,7 +140,6 @@ static VNET_DEFINE(int, parallel_tunnels static VNET_DEFINE(int, parallel_tunnels) = 0; #endif #define V_parallel_tunnels VNET(parallel_tunnels) - SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, parallel_tunnels, CTLFLAG_RW, &VNET_NAME(parallel_tunnels), 0, "Allow parallel tunnels?"); Modified: head/sys/net/if_gif.h ============================================================================== --- head/sys/net/if_gif.h Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/net/if_gif.h Thu Apr 29 11:52:42 2010 (r207369) @@ -118,10 +118,6 @@ int gif_ioctl(struct ifnet *, u_long, ca int gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *); void gif_delete_tunnel(struct ifnet *); int gif_encapcheck(const struct mbuf *, int, int, void *); - -VNET_DECLARE(int, ip_gif_ttl); -#define V_ip_gif_ttl VNET(ip_gif_ttl) - #endif /* _KERNEL */ #define GIFGOPTS _IOWR('i', 150, struct ifreq) Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/net/route.c Thu Apr 29 11:52:42 2010 (r207369) @@ -88,15 +88,14 @@ SYSCTL_INT(_net, OID_AUTO, add_addr_allf &rt_add_addr_allfibs, 0, ""); TUNABLE_INT("net.add_addr_allfibs", &rt_add_addr_allfibs); -VNET_DEFINE(struct radix_node_head *, rt_tables); -static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ -VNET_DEFINE(int, rttrash); /* routes not in table but not freed */ VNET_DEFINE(struct rtstat, rtstat); +#define V_rtstat VNET(rtstat) +VNET_DEFINE(struct radix_node_head *, rt_tables); #define V_rt_tables VNET(rt_tables) -#define V_rtzone VNET(rtzone) + +VNET_DEFINE(int, rttrash); /* routes not in table but not freed */ #define V_rttrash VNET(rttrash) -#define V_rtstat VNET(rtstat) /* compare two sockaddr structures */ @@ -114,6 +113,9 @@ VNET_DEFINE(struct rtstat, rtstat); */ #define RNTORT(p) ((struct rtentry *)(p)) +static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ +#define V_rtzone VNET(rtzone) + #if 0 /* default fib for tunnels to use */ u_int tunnel_fib = 0; Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/icmp6.h Thu Apr 29 11:52:42 2010 (r207369) @@ -652,7 +652,6 @@ struct rtentry; struct rttimer; struct in6_multi; # endif -void icmp6_init(void); void icmp6_paramerror(struct mbuf *, int); void icmp6_error(struct mbuf *, int, int, int); void icmp6_error2(struct mbuf *, int, int, int, struct ifnet *); Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/if_ether.c Thu Apr 29 11:52:42 2010 (r207369) @@ -82,16 +82,15 @@ SYSCTL_DECL(_net_link_ether); SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, ""); SYSCTL_NODE(_net_link_ether, PF_ARP, arp, CTLFLAG_RW, 0, ""); -VNET_DEFINE(int, useloopback) = 1; /* use loopback interface for - * local traffic */ - /* timer values */ static VNET_DEFINE(int, arpt_keep) = (20*60); /* once resolved, good for 20 * minutes */ +static VNET_DEFINE(int, arp_maxtries) = 5; +VNET_DEFINE(int, useloopback) = 1; /* use loopback interface for + * local traffic */ +static VNET_DEFINE(int, arp_proxyall) = 0; static VNET_DEFINE(int, arpt_down) = 20; /* keep incomplete entries for * 20 seconds */ -static VNET_DEFINE(int, arp_maxtries) = 5; -static VNET_DEFINE(int, arp_proxyall); static VNET_DEFINE(struct arpstat, arpstat); /* ARP statistics, see if_arp.h */ #define V_arpt_keep VNET(arpt_keep) @@ -103,7 +102,6 @@ static VNET_DEFINE(struct arpstat, arpst SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW, &VNET_NAME(arpt_keep), 0, "ARP entry lifetime in seconds"); - SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, maxtries, CTLFLAG_RW, &VNET_NAME(arp_maxtries), 0, "ARP resolution attempts before returning error"); Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/in.c Thu Apr 29 11:52:42 2010 (r207369) @@ -77,20 +77,19 @@ static int in_ifinit(struct ifnet *, static void in_purgemaddrs(struct ifnet *); static VNET_DEFINE(int, subnetsarelocal); -static VNET_DEFINE(int, sameprefixcarponly); -VNET_DECLARE(struct inpcbinfo, ripcbinfo); - #define V_subnetsarelocal VNET(subnetsarelocal) -#define V_sameprefixcarponly VNET(sameprefixcarponly) -#define V_ripcbinfo VNET(ripcbinfo) - SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, subnets_are_local, CTLFLAG_RW, &VNET_NAME(subnetsarelocal), 0, "Treat all subnets as directly connected"); +static VNET_DEFINE(int, sameprefixcarponly); +#define V_sameprefixcarponly VNET(sameprefixcarponly) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, same_prefix_carp_only, CTLFLAG_RW, &VNET_NAME(sameprefixcarponly), 0, "Refuse to create same prefixes on different interfaces"); +VNET_DECLARE(struct inpcbinfo, ripcbinfo); +#define V_ripcbinfo VNET(ripcbinfo) + /* * Return 1 if an internet address is for a ``local'' host * (one to which we have a connection). If subnetsarelocal Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/in_gif.c Thu Apr 29 11:52:42 2010 (r207369) @@ -85,6 +85,8 @@ struct protosw in_gif_protosw = { .pr_usrreqs = &rip_usrreqs }; +VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL; +#define V_ip_gif_ttl VNET(ip_gif_ttl) SYSCTL_VNET_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_RW, &VNET_NAME(ip_gif_ttl), 0, ""); Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/in_proto.c Thu Apr 29 11:52:42 2010 (r207369) @@ -208,7 +208,6 @@ struct protosw inetsw[] = { .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp_input, .pr_ctloutput = rip_ctloutput, - .pr_init = icmp_init, .pr_usrreqs = &rip_usrreqs }, { Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/in_rmx.c Thu Apr 29 11:52:42 2010 (r207369) @@ -131,22 +131,22 @@ in_matroute(void *v_arg, struct radix_no return rn; } -static VNET_DEFINE(int, rtq_reallyold); -static VNET_DEFINE(int, rtq_minreallyold); -static VNET_DEFINE(int, rtq_toomany); - +static VNET_DEFINE(int, rtq_reallyold) = 60*60; /* one hour is "really old" */ #define V_rtq_reallyold VNET(rtq_reallyold) -#define V_rtq_minreallyold VNET(rtq_minreallyold) -#define V_rtq_toomany VNET(rtq_toomany) - SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire, CTLFLAG_RW, &VNET_NAME(rtq_reallyold), 0, "Default expiration time on dynamically learned routes"); +/* never automatically crank down to less */ +static VNET_DEFINE(int, rtq_minreallyold) = 10; +#define V_rtq_minreallyold VNET(rtq_minreallyold) SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire, CTLFLAG_RW, &VNET_NAME(rtq_minreallyold), 0, "Minimum time to attempt to hold onto dynamically learned routes"); +/* 128 cached routes is "too many" */ +static VNET_DEFINE(int, rtq_toomany) = 128; +#define V_rtq_toomany VNET(rtq_toomany) SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache, CTLFLAG_RW, &VNET_NAME(rtq_toomany), 0, "Upper limit on dynamically learned routes"); @@ -239,7 +239,7 @@ in_rtqkill(struct radix_node *rn, void * } #define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */ -static VNET_DEFINE(int, rtq_timeout); +static VNET_DEFINE(int, rtq_timeout) = RTQ_TIMEOUT; static VNET_DEFINE(struct callout, rtq_timer); #define V_rtq_timeout VNET(rtq_timeout) @@ -362,11 +362,6 @@ in_inithead(void **head, int off) if (off == 0) /* XXX MRT see above */ return 1; /* only do the rest for a real routing table */ - V_rtq_reallyold = 60*60; /* one hour is "really old" */ - V_rtq_minreallyold = 10; /* never automatically crank down to less */ - V_rtq_toomany = 128; /* 128 cached routes is "too many" */ - V_rtq_timeout = RTQ_TIMEOUT; - rnh = *head; rnh->rnh_addaddr = in_addroute; rnh->rnh_matchaddr = in_matroute; Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/ip_icmp.c Thu Apr 29 11:52:42 2010 (r207369) @@ -75,65 +75,60 @@ __FBSDID("$FreeBSD$"); * routines to turnaround packets back to the originator, and * host table maintenance routines. */ - VNET_DEFINE(struct icmpstat, icmpstat); -static VNET_DEFINE(int, icmpmaskrepl); -static VNET_DEFINE(u_int, icmpmaskfake); -static VNET_DEFINE(int, drop_redirect); -static VNET_DEFINE(int, log_redirect); -static VNET_DEFINE(int, icmplim); -static VNET_DEFINE(int, icmplim_output); -static VNET_DEFINE(char, reply_src[IFNAMSIZ]); -static VNET_DEFINE(int, icmp_rfi); -static VNET_DEFINE(int, icmp_quotelen); -static VNET_DEFINE(int, icmpbmcastecho); - -#define V_icmpmaskrepl VNET(icmpmaskrepl) -#define V_icmpmaskfake VNET(icmpmaskfake) -#define V_drop_redirect VNET(drop_redirect) -#define V_log_redirect VNET(log_redirect) -#define V_icmplim VNET(icmplim) -#define V_icmplim_output VNET(icmplim_output) -#define V_reply_src VNET(reply_src) -#define V_icmp_rfi VNET(icmp_rfi) -#define V_icmp_quotelen VNET(icmp_quotelen) -#define V_icmpbmcastecho VNET(icmpbmcastecho) - SYSCTL_VNET_STRUCT(_net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RW, &VNET_NAME(icmpstat), icmpstat, ""); +static VNET_DEFINE(int, icmpmaskrepl) = 0; +#define V_icmpmaskrepl VNET(icmpmaskrepl) SYSCTL_VNET_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW, &VNET_NAME(icmpmaskrepl), 0, "Reply to ICMP Address Mask Request packets."); +static VNET_DEFINE(u_int, icmpmaskfake) = 0; +#define V_icmpmaskfake VNET(icmpmaskfake) SYSCTL_VNET_UINT(_net_inet_icmp, OID_AUTO, maskfake, CTLFLAG_RW, &VNET_NAME(icmpmaskfake), 0, "Fake reply to ICMP Address Mask Request packets."); +static VNET_DEFINE(int, drop_redirect) = 0; +#define V_drop_redirect VNET(drop_redirect) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, drop_redirect, CTLFLAG_RW, &VNET_NAME(drop_redirect), 0, "Ignore ICMP redirects"); +static VNET_DEFINE(int, log_redirect) = 0; +#define V_log_redirect VNET(log_redirect) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, log_redirect, CTLFLAG_RW, &VNET_NAME(log_redirect), 0, "Log ICMP redirects to the console"); +static VNET_DEFINE(int, icmplim) = 200; +#define V_icmplim VNET(icmplim) SYSCTL_VNET_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW, &VNET_NAME(icmplim), 0, "Maximum number of ICMP responses per second"); +static VNET_DEFINE(int, icmplim_output) = 1; +#define V_icmplim_output VNET(icmplim_output) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW, &VNET_NAME(icmplim_output), 0, "Enable rate limiting of ICMP responses"); +static VNET_DEFINE(char, reply_src[IFNAMSIZ]); +#define V_reply_src VNET(reply_src) SYSCTL_VNET_STRING(_net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_RW, &VNET_NAME(reply_src), IFNAMSIZ, "icmp reply source for non-local packets."); +static VNET_DEFINE(int, icmp_rfi) = 0; +#define V_icmp_rfi VNET(icmp_rfi) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, reply_from_interface, CTLFLAG_RW, &VNET_NAME(icmp_rfi), 0, "ICMP reply from incoming interface for non-local packets"); +static VNET_DEFINE(int, icmp_quotelen) = 8; +#define V_icmp_quotelen VNET(icmp_quotelen) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, quotelen, CTLFLAG_RW, &VNET_NAME(icmp_quotelen), 0, "Number of bytes from original packet to quote in ICMP reply"); @@ -141,7 +136,8 @@ SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO /* * ICMP broadcast echo sysctl */ - +static VNET_DEFINE(int, icmpbmcastecho) = 0; +#define V_icmpbmcastecho VNET(icmpbmcastecho) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, &VNET_NAME(icmpbmcastecho), 0, ""); @@ -156,21 +152,6 @@ static void icmp_send(struct mbuf *, str extern struct protosw inetsw[]; -void -icmp_init(void) -{ - - V_icmpmaskrepl = 0; - V_icmpmaskfake = 0; - V_drop_redirect = 0; - V_log_redirect = 0; - V_icmplim = 200; - V_icmplim_output = 1; - V_icmp_rfi = 0; - V_icmp_quotelen = 8; - V_icmpbmcastecho = 0; -} - /* * Kernel module interface for updating icmpstat. The argument is an index * into icmpstat treated as an array of u_long. While this encodes the Modified: head/sys/netinet/ip_icmp.h ============================================================================== --- head/sys/netinet/ip_icmp.h Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/ip_icmp.h Thu Apr 29 11:52:42 2010 (r207369) @@ -208,7 +208,6 @@ struct icmp { #ifdef _KERNEL void icmp_error(struct mbuf *, int, int, uint32_t, int); void icmp_input(struct mbuf *, int); -void icmp_init(void); int ip_next_mtu(int, int); #endif Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/ip_input.c Thu Apr 29 11:52:42 2010 (r207369) @@ -89,66 +89,40 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct ip) == 20); #endif -static VNET_DEFINE(int, ipsendredirects) = 1; /* XXX */ -static VNET_DEFINE(int, ip_checkinterface); -static VNET_DEFINE(int, ip_keepfaith); -static VNET_DEFINE(int, ip_sendsourcequench); - -#define V_ipsendredirects VNET(ipsendredirects) -#define V_ip_checkinterface VNET(ip_checkinterface) -#define V_ip_keepfaith VNET(ip_keepfaith) -#define V_ip_sendsourcequench VNET(ip_sendsourcequench) - -VNET_DEFINE(int, ip_defttl) = IPDEFTTL; -VNET_DEFINE(int, ip_do_randomid); -VNET_DEFINE(int, ipforwarding); - -VNET_DEFINE(struct in_ifaddrhead, in_ifaddrhead); /* first inet address */ -VNET_DEFINE(struct in_ifaddrhashhead *, in_ifaddrhashtbl); /* inet addr hash table */ -VNET_DEFINE(u_long, in_ifaddrhmask); /* mask for hash table */ -VNET_DEFINE(struct ipstat, ipstat); - -static VNET_DEFINE(int, ip_rsvp_on); -VNET_DEFINE(struct socket *, ip_rsvpd); -VNET_DEFINE(int, rsvp_on); - -#define V_ip_rsvp_on VNET(ip_rsvp_on) - -static VNET_DEFINE(TAILQ_HEAD(ipqhead, ipq), ipq[IPREASS_NHASH]); -static VNET_DEFINE(int, maxnipq); /* Administrative limit on # reass queues. */ -static VNET_DEFINE(int, maxfragsperpacket); -static VNET_DEFINE(int, nipq); /* Total # of reass queues */ - -#define V_ipq VNET(ipq) -#define V_maxnipq VNET(maxnipq) -#define V_maxfragsperpacket VNET(maxfragsperpacket) -#define V_nipq VNET(nipq) - -VNET_DEFINE(int, ipstealth); - struct rwlock in_ifaddr_lock; RW_SYSINIT(in_ifaddr_lock, &in_ifaddr_lock, "in_ifaddr_lock"); +VNET_DEFINE(int, rsvp_on); + +VNET_DEFINE(int, ipforwarding); SYSCTL_VNET_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW, &VNET_NAME(ipforwarding), 0, "Enable IP forwarding between interfaces"); +static VNET_DEFINE(int, ipsendredirects) = 1; /* XXX */ +#define V_ipsendredirects VNET(ipsendredirects) SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_RW, &VNET_NAME(ipsendredirects), 0, "Enable sending IP redirects"); +VNET_DEFINE(int, ip_defttl) = IPDEFTTL; SYSCTL_VNET_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW, &VNET_NAME(ip_defttl), 0, "Maximum TTL on IP packets"); +static VNET_DEFINE(int, ip_keepfaith); +#define V_ip_keepfaith VNET(ip_keepfaith) SYSCTL_VNET_INT(_net_inet_ip, IPCTL_KEEPFAITH, keepfaith, CTLFLAG_RW, &VNET_NAME(ip_keepfaith), 0, "Enable packet capture for FAITH IPv4->IPv6 translater daemon"); +static VNET_DEFINE(int, ip_sendsourcequench); +#define V_ip_sendsourcequench VNET(ip_sendsourcequench) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, sendsourcequench, CTLFLAG_RW, &VNET_NAME(ip_sendsourcequench), 0, "Enable the transmission of source quench packets"); +VNET_DEFINE(int, ip_do_randomid); SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, random_id, CTLFLAG_RW, &VNET_NAME(ip_do_randomid), 0, "Assign random ip_id values"); @@ -166,6 +140,8 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, * to the loopback interface instead of the interface where the * packets for those addresses are received. */ +static VNET_DEFINE(int, ip_checkinterface); +#define V_ip_checkinterface VNET(ip_checkinterface) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, check_interface, CTLFLAG_RW, &VNET_NAME(ip_checkinterface), 0, "Verify packet arrives on correct interface"); @@ -182,16 +158,22 @@ static struct netisr_handler ip_nh = { extern struct domain inetdomain; extern struct protosw inetsw[]; u_char ip_protox[IPPROTO_MAX]; +VNET_DEFINE(struct in_ifaddrhead, in_ifaddrhead); /* first inet address */ +VNET_DEFINE(struct in_ifaddrhashhead *, in_ifaddrhashtbl); /* inet addr hash table */ +VNET_DEFINE(u_long, in_ifaddrhmask); /* mask for hash table */ +VNET_DEFINE(struct ipstat, ipstat); SYSCTL_VNET_STRUCT(_net_inet_ip, IPCTL_STATS, stats, CTLFLAG_RW, &VNET_NAME(ipstat), ipstat, "IP statistics (struct ipstat, netinet/ip_var.h)"); static VNET_DEFINE(uma_zone_t, ipq_zone); -#define V_ipq_zone VNET(ipq_zone) - +static VNET_DEFINE(TAILQ_HEAD(ipqhead, ipq), ipq[IPREASS_NHASH]); static struct mtx ipqlock; +#define V_ipq_zone VNET(ipq_zone) +#define V_ipq VNET(ipq) + #define IPQ_LOCK() mtx_lock(&ipqlock) #define IPQ_UNLOCK() mtx_unlock(&ipqlock) #define IPQ_LOCK_INIT() mtx_init(&ipqlock, "ipqlock", NULL, MTX_DEF) @@ -201,10 +183,16 @@ static void maxnipq_update(void); static void ipq_zone_change(void *); static void ip_drain_locked(void); +static VNET_DEFINE(int, maxnipq); /* Administrative limit on # reass queues. */ +static VNET_DEFINE(int, nipq); /* Total # of reass queues */ +#define V_maxnipq VNET(maxnipq) +#define V_nipq VNET(nipq) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, fragpackets, CTLFLAG_RD, &VNET_NAME(nipq), 0, "Current number of IPv4 fragment reassembly queue entries"); +static VNET_DEFINE(int, maxfragsperpacket); +#define V_maxfragsperpacket VNET(maxfragsperpacket) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, maxfragsperpacket, CTLFLAG_RW, &VNET_NAME(maxfragsperpacket), 0, "Maximum number of IPv4 fragments allowed per packet"); @@ -217,6 +205,7 @@ SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, m #endif #ifdef IPSTEALTH +VNET_DEFINE(int, ipstealth); SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, stealth, CTLFLAG_RW, &VNET_NAME(ipstealth), 0, "IP stealth mode, no TTL decrementation on forwarding"); @@ -1740,6 +1729,11 @@ makedummy: * locking. This code remains in ip_input.c as ip_mroute.c is optionally * compiled. */ +static VNET_DEFINE(int, ip_rsvp_on); +VNET_DEFINE(struct socket *, ip_rsvpd); + +#define V_ip_rsvp_on VNET(ip_rsvp_on) + int ip_rsvp_init(struct socket *so) { Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/ip_var.h Thu Apr 29 11:52:42 2010 (r207369) @@ -181,9 +181,13 @@ VNET_DECLARE(int, ipforwarding); /* ip #ifdef IPSTEALTH VNET_DECLARE(int, ipstealth); /* stealth forwarding */ #endif -VNET_DECLARE(int, rsvp_on); +extern u_char ip_protox[]; VNET_DECLARE(struct socket *, ip_rsvpd); /* reservation protocol daemon*/ VNET_DECLARE(struct socket *, ip_mrouter); /* multicast routing daemon */ +extern int (*legal_vif_num)(int); +extern u_long (*ip_mcast_src)(int); +VNET_DECLARE(int, rsvp_on); +extern struct pr_usrreqs rip_usrreqs; #define V_ipstat VNET(ipstat) #define V_ip_id VNET(ip_id) @@ -192,14 +196,9 @@ VNET_DECLARE(struct socket *, ip_mrouter #ifdef IPSTEALTH #define V_ipstealth VNET(ipstealth) #endif -#define V_rsvp_on VNET(rsvp_on) #define V_ip_rsvpd VNET(ip_rsvpd) #define V_ip_mrouter VNET(ip_mrouter) - -extern u_char ip_protox[]; -extern int (*legal_vif_num)(int); -extern u_long (*ip_mcast_src)(int); -extern struct pr_usrreqs rip_usrreqs; +#define V_rsvp_on VNET(rsvp_on) void inp_freemoptions(struct ip_moptions *); int inp_getmoptions(struct inpcb *, struct sockopt *); Modified: head/sys/netinet/tcp_hostcache.c ============================================================================== --- head/sys/netinet/tcp_hostcache.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/tcp_hostcache.c Thu Apr 29 11:52:42 2010 (r207369) @@ -107,9 +107,9 @@ __FBSDID("$FreeBSD$"); #define TCP_HOSTCACHE_PRUNE 5*60 /* every 5 minutes */ static VNET_DEFINE(struct tcp_hostcache, tcp_hostcache); -static VNET_DEFINE(struct callout, tcp_hc_callout); - #define V_tcp_hostcache VNET(tcp_hostcache) + +static VNET_DEFINE(struct callout, tcp_hc_callout); #define V_tcp_hc_callout VNET(tcp_hc_callout) static struct hc_metrics *tcp_hc_lookup(struct in_conninfo *); Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/tcp_input.c Thu Apr 29 11:52:42 2010 (r207369) @@ -99,20 +99,6 @@ __FBSDID("$FreeBSD$"); static const int tcprexmtthresh = 3; VNET_DEFINE(struct tcpstat, tcpstat); -VNET_DEFINE(int, blackhole); -VNET_DEFINE(int, tcp_delack_enabled); -VNET_DEFINE(int, drop_synfin); -VNET_DEFINE(int, tcp_do_rfc3042); -VNET_DEFINE(int, tcp_do_rfc3390); -VNET_DEFINE(int, tcp_do_ecn); -VNET_DEFINE(int, tcp_ecn_maxretries); -VNET_DEFINE(int, tcp_insecure_rst); -VNET_DEFINE(int, tcp_do_autorcvbuf); -VNET_DEFINE(int, tcp_autorcvbuf_inc); -VNET_DEFINE(int, tcp_autorcvbuf_max); -VNET_DEFINE(int, tcp_do_rfc3465); -VNET_DEFINE(int, tcp_abc_l_var); - SYSCTL_VNET_STRUCT(_net_inet_tcp, TCPCTL_STATS, stats, CTLFLAG_RW, &VNET_NAME(tcpstat), tcpstat, "TCP statistics (struct tcpstat, netinet/tcp_var.h)"); @@ -122,56 +108,79 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_ &tcp_log_in_vain, 0, "Log all incoming TCP segments to closed ports"); +VNET_DEFINE(int, blackhole) = 0; +#define V_blackhole VNET(blackhole) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, blackhole, CTLFLAG_RW, &VNET_NAME(blackhole), 0, "Do not send RST on segments to closed ports"); +VNET_DEFINE(int, tcp_delack_enabled) = 1; SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, delayed_ack, CTLFLAG_RW, &VNET_NAME(tcp_delack_enabled), 0, "Delay ACK to try and piggyback it onto a data packet"); +VNET_DEFINE(int, drop_synfin) = 0; +#define V_drop_synfin VNET(drop_synfin) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_RW, &VNET_NAME(drop_synfin), 0, "Drop TCP packets with SYN+FIN set"); +VNET_DEFINE(int, tcp_do_rfc3042) = 1; +#define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3042), 0, "Enable RFC 3042 (Limited Transmit)"); +VNET_DEFINE(int, tcp_do_rfc3390) = 1; +#define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3390), 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); +VNET_DEFINE(int, tcp_do_rfc3465) = 1; +#define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3465), 0, "Enable RFC 3465 (Appropriate Byte Counting)"); +VNET_DEFINE(int, tcp_abc_l_var) = 2; +#define V_tcp_abc_l_var VNET(tcp_abc_l_var) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, abc_l_var, CTLFLAG_RW, &VNET_NAME(tcp_abc_l_var), 2, "Cap the max cwnd increment during slow-start to this number of segments"); SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW, 0, "TCP ECN"); +VNET_DEFINE(int, tcp_do_ecn) = 0; SYSCTL_VNET_INT(_net_inet_tcp_ecn, OID_AUTO, enable, CTLFLAG_RW, &VNET_NAME(tcp_do_ecn), 0, "TCP ECN support"); +VNET_DEFINE(int, tcp_ecn_maxretries) = 1; SYSCTL_VNET_INT(_net_inet_tcp_ecn, OID_AUTO, maxretries, CTLFLAG_RW, &VNET_NAME(tcp_ecn_maxretries), 0, "Max retries before giving up on ECN"); +VNET_DEFINE(int, tcp_insecure_rst) = 0; +#define V_tcp_insecure_rst VNET(tcp_insecure_rst) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, insecure_rst, CTLFLAG_RW, &VNET_NAME(tcp_insecure_rst), 0, "Follow the old (insecure) criteria for accepting RST packets"); +VNET_DEFINE(int, tcp_do_autorcvbuf) = 1; +#define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_RW, &VNET_NAME(tcp_do_autorcvbuf), 0, "Enable automatic receive buffer sizing"); +VNET_DEFINE(int, tcp_autorcvbuf_inc) = 16*1024; +#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_inc, CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_inc), 0, "Incrementor step size of automatic receive buffer"); +VNET_DEFINE(int, tcp_autorcvbuf_max) = 256*1024; +#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_max), 0, "Max size of automatic receive buffer"); @@ -181,8 +190,8 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, read &tcp_read_locking, 0, "Enable read locking strategy"); VNET_DEFINE(struct inpcbhead, tcb); -VNET_DEFINE(struct inpcbinfo, tcbinfo); #define tcb6 tcb /* for KAME src sync over BSD*'s */ +VNET_DEFINE(struct inpcbinfo, tcbinfo); static void tcp_dooptions(struct tcpopt *, u_char *, int, int); static void tcp_do_segment(struct mbuf *, struct tcphdr *, Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/tcp_output.c Thu Apr 29 11:52:42 2010 (r207369) @@ -87,43 +87,46 @@ __FBSDID("$FreeBSD$"); extern struct mbuf *m_copypack(); #endif -VNET_DEFINE(int, path_mtu_discovery); -VNET_DEFINE(int, ss_fltsz); -VNET_DEFINE(int, ss_fltsz_local); -VNET_DEFINE(int, tcp_do_newreno); -VNET_DEFINE(int, tcp_do_tso); -VNET_DEFINE(int, tcp_do_autosndbuf); -VNET_DEFINE(int, tcp_autosndbuf_inc); -VNET_DEFINE(int, tcp_autosndbuf_max); - +VNET_DEFINE(int, path_mtu_discovery) = 1; SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, path_mtu_discovery, CTLFLAG_RW, &VNET_NAME(path_mtu_discovery), 1, "Enable Path MTU Discovery"); +VNET_DEFINE(int, ss_fltsz) = 1; SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, slowstart_flightsize, CTLFLAG_RW, &VNET_NAME(ss_fltsz), 1, "Slow start flight size"); +VNET_DEFINE(int, ss_fltsz_local) = 4; SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, local_slowstart_flightsize, CTLFLAG_RW, &VNET_NAME(ss_fltsz_local), 1, "Slow start flight size for local networks"); +VNET_DEFINE(int, tcp_do_newreno) = 1; SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, newreno, CTLFLAG_RW, &VNET_NAME(tcp_do_newreno), 0, "Enable NewReno Algorithms"); +VNET_DEFINE(int, tcp_do_tso) = 1; +#define V_tcp_do_tso VNET(tcp_do_tso) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, tso, CTLFLAG_RW, &VNET_NAME(tcp_do_tso), 0, "Enable TCP Segmentation Offload"); +VNET_DEFINE(int, tcp_do_autosndbuf) = 1; +#define V_tcp_do_autosndbuf VNET(tcp_do_autosndbuf) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto, CTLFLAG_RW, &VNET_NAME(tcp_do_autosndbuf), 0, "Enable automatic send buffer sizing"); +VNET_DEFINE(int, tcp_autosndbuf_inc) = 8*1024; +#define V_tcp_autosndbuf_inc VNET(tcp_autosndbuf_inc) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_inc, CTLFLAG_RW, &VNET_NAME(tcp_autosndbuf_inc), 0, "Incrementor step size of automatic send buffer"); +VNET_DEFINE(int, tcp_autosndbuf_max) = 256*1024; +#define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_RW, &VNET_NAME(tcp_autosndbuf_max), 0, "Max size of automatic send buffer"); Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/tcp_reass.c Thu Apr 29 11:52:42 2010 (r207369) @@ -74,30 +74,28 @@ __FBSDID("$FreeBSD$"); #include #endif /* TCPDEBUG */ -static VNET_DEFINE(int, tcp_reass_maxseg); -VNET_DEFINE(int, tcp_reass_qsize); -static VNET_DEFINE(int, tcp_reass_maxqlen); -static VNET_DEFINE(int, tcp_reass_overflows); - -#define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) -#define V_tcp_reass_maxqlen VNET(tcp_reass_maxqlen) -#define V_tcp_reass_overflows VNET(tcp_reass_overflows) - SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, "TCP Segment Reassembly Queue"); +static VNET_DEFINE(int, tcp_reass_maxseg) = 0; +#define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, &VNET_NAME(tcp_reass_maxseg), 0, "Global maximum number of TCP Segments in Reassembly Queue"); +VNET_DEFINE(int, tcp_reass_qsize) = 0; SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_RD, &VNET_NAME(tcp_reass_qsize), 0, "Global number of TCP Segments currently in Reassembly Queue"); +static VNET_DEFINE(int, tcp_reass_maxqlen) = 48; +#define V_tcp_reass_maxqlen VNET(tcp_reass_maxqlen) SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxqlen, CTLFLAG_RW, &VNET_NAME(tcp_reass_maxqlen), 0, "Maximum number of TCP Segments per individual Reassembly Queue"); +static VNET_DEFINE(int, tcp_reass_overflows) = 0; +#define V_tcp_reass_overflows VNET(tcp_reass_overflows) SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, CTLFLAG_RD, &VNET_NAME(tcp_reass_overflows), 0, "Global number of TCP Segment Reassembly Queue Overflows"); @@ -117,11 +115,6 @@ void tcp_reass_init(void) { - V_tcp_reass_maxseg = 0; - V_tcp_reass_qsize = 0; - V_tcp_reass_maxqlen = 48; - V_tcp_reass_overflows = 0; - V_tcp_reass_maxseg = nmbclusters / 16; TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments", &V_tcp_reass_maxseg); Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/tcp_sack.c Thu Apr 29 11:52:42 2010 (r207369) @@ -123,29 +123,28 @@ __FBSDID("$FreeBSD$"); #include VNET_DECLARE(struct uma_zone *, sack_hole_zone); -VNET_DEFINE(int, tcp_do_sack); -VNET_DEFINE(int, tcp_sack_maxholes); -VNET_DEFINE(int, tcp_sack_globalmaxholes); -VNET_DEFINE(int, tcp_sack_globalholes); - #define V_sack_hole_zone VNET(sack_hole_zone) -#define V_tcp_do_sack VNET(tcp_do_sack) -#define V_tcp_sack_maxholes VNET(tcp_sack_maxholes) -#define V_tcp_sack_globalmaxholes VNET(tcp_sack_globalmaxholes) -#define V_tcp_sack_globalholes VNET(tcp_sack_globalholes) SYSCTL_NODE(_net_inet_tcp, OID_AUTO, sack, CTLFLAG_RW, 0, "TCP SACK"); +VNET_DEFINE(int, tcp_do_sack) = 1; +#define V_tcp_do_sack VNET(tcp_do_sack) SYSCTL_VNET_INT(_net_inet_tcp_sack, OID_AUTO, enable, CTLFLAG_RW, &VNET_NAME(tcp_do_sack), 0, "Enable/Disable TCP SACK support"); +VNET_DEFINE(int, tcp_sack_maxholes) = 128; +#define V_tcp_sack_maxholes VNET(tcp_sack_maxholes) SYSCTL_VNET_INT(_net_inet_tcp_sack, OID_AUTO, maxholes, CTLFLAG_RW, &VNET_NAME(tcp_sack_maxholes), 0, "Maximum number of TCP SACK holes allowed per connection"); +VNET_DEFINE(int, tcp_sack_globalmaxholes) = 65536; +#define V_tcp_sack_globalmaxholes VNET(tcp_sack_globalmaxholes) SYSCTL_VNET_INT(_net_inet_tcp_sack, OID_AUTO, globalmaxholes, CTLFLAG_RW, &VNET_NAME(tcp_sack_globalmaxholes), 0, "Global maximum number of TCP SACK holes"); +VNET_DEFINE(int, tcp_sack_globalholes) = 0; +#define V_tcp_sack_globalholes VNET(tcp_sack_globalholes) SYSCTL_VNET_INT(_net_inet_tcp_sack, OID_AUTO, globalholes, CTLFLAG_RD, &VNET_NAME(tcp_sack_globalholes), 0, "Global number of TCP SACK holes currently allocated"); Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Apr 29 10:34:54 2010 (r207368) +++ head/sys/netinet/tcp_subr.c Thu Apr 29 11:52:42 2010 (r207369) @@ -111,28 +111,10 @@ __FBSDID("$FreeBSD$"); #include -VNET_DEFINE(int, tcp_mssdflt); +VNET_DEFINE(int, tcp_mssdflt) = TCP_MSS; #ifdef INET6 -VNET_DEFINE(int, tcp_v6mssdflt); +VNET_DEFINE(int, tcp_v6mssdflt) = TCP6_MSS; #endif -VNET_DEFINE(int, tcp_minmss); -VNET_DEFINE(int, tcp_do_rfc1323); - -static VNET_DEFINE(int, icmp_may_rst); -static VNET_DEFINE(int, tcp_isn_reseed_interval); -static VNET_DEFINE(int, tcp_inflight_enable); -static VNET_DEFINE(int, tcp_inflight_rttthresh); -static VNET_DEFINE(int, tcp_inflight_min); -static VNET_DEFINE(int, tcp_inflight_max); -static VNET_DEFINE(int, tcp_inflight_stab); - -#define V_icmp_may_rst VNET(icmp_may_rst) -#define V_tcp_isn_reseed_interval VNET(tcp_isn_reseed_interval) -#define V_tcp_inflight_enable VNET(tcp_inflight_enable) -#define V_tcp_inflight_rttthresh VNET(tcp_inflight_rttthresh) -#define V_tcp_inflight_min VNET(tcp_inflight_min) -#define V_tcp_inflight_max VNET(tcp_inflight_max) -#define V_tcp_inflight_stab VNET(tcp_inflight_stab) static int sysctl_net_inet_tcp_mss_check(SYSCTL_HANDLER_ARGS) @@ -194,10 +176,12 @@ vnet_sysctl_msec_to_ticks(SYSCTL_HANDLER * with packet generation and sending. Set to zero to disable MINMSS * checking. This setting prevents us from sending too small packets. */ +VNET_DEFINE(int, tcp_minmss) = TCP_MINMSS; SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, minmss, CTLFLAG_RW, &VNET_NAME(tcp_minmss), 0, "Minmum TCP Maximum Segment Size"); +VNET_DEFINE(int, tcp_do_rfc1323) = 1; SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323, CTLFLAG_RW, &VNET_NAME(tcp_do_rfc1323), 0, "Enable rfc1323 (high performance TCP) extensions"); @@ -217,10 +201,14 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, do_t SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, pcbcount, CTLFLAG_RD, &VNET_NAME(tcbinfo.ipi_count), 0, "Number of active PCBs"); +static VNET_DEFINE(int, icmp_may_rst) = 1; +#define V_icmp_may_rst VNET(icmp_may_rst) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, icmp_may_rst, CTLFLAG_RW, &VNET_NAME(icmp_may_rst), 0, "Certain ICMP unreachable messages may abort connections in SYN_SENT"); +static VNET_DEFINE(int, tcp_isn_reseed_interval) = 0; +#define V_tcp_isn_reseed_interval VNET(tcp_isn_reseed_interval) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, isn_reseed_interval, CTLFLAG_RW, &VNET_NAME(tcp_isn_reseed_interval), 0, "Seconds between reseeding of ISN secret"); @@ -233,6 +221,8 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, SYSCTL_NODE(_net_inet_tcp, OID_AUTO, inflight, CTLFLAG_RW, 0, "TCP inflight data limiting"); +static VNET_DEFINE(int, tcp_inflight_enable) = 1; +#define V_tcp_inflight_enable VNET(tcp_inflight_enable) SYSCTL_VNET_INT(_net_inet_tcp_inflight, OID_AUTO, enable, CTLFLAG_RW, &VNET_NAME(tcp_inflight_enable), 0, "Enable automatic TCP inflight data limiting"); @@ -242,19 +232,27 @@ SYSCTL_INT(_net_inet_tcp_inflight, OID_A &tcp_inflight_debug, 0, "Debug TCP inflight calculations"); +static VNET_DEFINE(int, tcp_inflight_rttthresh); +#define V_tcp_inflight_rttthresh VNET(tcp_inflight_rttthresh) SYSCTL_VNET_PROC(_net_inet_tcp_inflight, OID_AUTO, rttthresh, CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(tcp_inflight_rttthresh), 0, vnet_sysctl_msec_to_ticks, "I", "RTT threshold below which inflight will deactivate itself"); +static VNET_DEFINE(int, tcp_inflight_min) = 6144; +#define V_tcp_inflight_min VNET(tcp_inflight_min) SYSCTL_VNET_INT(_net_inet_tcp_inflight, OID_AUTO, min, CTLFLAG_RW, &VNET_NAME(tcp_inflight_min), 0, "Lower-bound for TCP inflight window"); +static VNET_DEFINE(int, tcp_inflight_max) = TCP_MAXWIN << TCP_MAX_WINSHIFT; +#define V_tcp_inflight_max VNET(tcp_inflight_max) SYSCTL_VNET_INT(_net_inet_tcp_inflight, OID_AUTO, max, CTLFLAG_RW, &VNET_NAME(tcp_inflight_max), 0, "Upper-bound for TCP inflight window"); +static VNET_DEFINE(int, tcp_inflight_stab) = 20; +#define V_tcp_inflight_stab VNET(tcp_inflight_stab) SYSCTL_VNET_INT(_net_inet_tcp_inflight, OID_AUTO, stab, CTLFLAG_RW, &VNET_NAME(tcp_inflight_stab), 0, "Inflight Algorithm Stabilization 20 = 2 packets"); @@ -329,53 +327,6 @@ tcp_init(void) { int hashsize; - V_blackhole = 0; - V_tcp_delack_enabled = 1; - V_drop_synfin = 0; - V_tcp_do_rfc3042 = 1; - V_tcp_do_rfc3390 = 1; - V_tcp_do_ecn = 0; - V_tcp_ecn_maxretries = 1; - V_tcp_insecure_rst = 0; - V_tcp_do_autorcvbuf = 1; - V_tcp_autorcvbuf_inc = 16*1024; - V_tcp_autorcvbuf_max = 256*1024; - V_tcp_do_rfc3465 = 1; - V_tcp_abc_l_var = 2; - - V_tcp_mssdflt = TCP_MSS; -#ifdef INET6 - V_tcp_v6mssdflt = TCP6_MSS; -#endif - V_tcp_minmss = TCP_MINMSS; - V_tcp_do_rfc1323 = 1; - V_icmp_may_rst = 1; - V_tcp_isn_reseed_interval = 0; - V_tcp_inflight_enable = 1; - V_tcp_inflight_min = 6144; - V_tcp_inflight_max = TCP_MAXWIN << TCP_MAX_WINSHIFT; - V_tcp_inflight_stab = 20; - - V_path_mtu_discovery = 1; - V_ss_fltsz = 1; - V_ss_fltsz_local = 4; - V_tcp_do_newreno = 1; - V_tcp_do_tso = 1; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 12:00:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AA1B1065695; Thu, 29 Apr 2010 12:00:40 +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 E65168FC21; Thu, 29 Apr 2010 12:00:39 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id D9B6B41C796; Thu, 29 Apr 2010 14:00:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id m1n4h58AlgLb; Thu, 29 Apr 2010 14:00:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 3277E41C7A5; Thu, 29 Apr 2010 14:00: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 EADF94448EC; Thu, 29 Apr 2010 11:58:09 +0000 (UTC) Date: Thu, 29 Apr 2010 11:58:09 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201004291152.o3TBqgiG024856@svn.freebsd.org> Message-ID: <20100429115400.P3531@maildrop.int.zabbadoz.net> References: <201004291152.o3TBqgiG024856@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: svn commit: r207369 - in head/sys: contrib/ipfilter/netinet net netinet netinet6 netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 12:00:40 -0000 On Thu, 29 Apr 2010, Bjoern A. Zeeb wrote: > Author: bz > Date: Thu Apr 29 11:52:42 2010 > New Revision: 207369 > URL: http://svn.freebsd.org/changeset/base/207369 > > Log: > MFP4: @176978-176982, 176984, 176990-176994, 177441 > > "Whitspace" churn after the VIMAGE/VNET whirls. > > Remove the need for some "init" functions within the network > stack, like pim6_init(), icmp_init() or significantly shorten > others like ip6_init() and nd6_init(), using static initialization > again where possible and formerly missed. > > Move (most) variables back to the place they used to be before the > container structs and VIMAGE_GLOABLS (before r185088) and try to > reduce the diff to stable/7 and earlier as good as possible, > to help out-of-tree consumers to update from 6.x or 7.x to 8 or 9. > > This also removes some header file pollution for putatively > static global variables. > > Revert VIMAGE specific changes in ipfilter::ip_auth.c, that are > no longer needed. > > Reviewed by: jhb > Discussed with: rwatson > Sponsored by: The FreeBSD Foundation > Sponsored by: CK Software GmbH > MFC after: 6 days Thanks also to philip and kib for their ideas on a commit strategy (that I might have ignored). Ideally this would have happened before 8.0 but we had been too far into the release cycle at that point and had to chase other real bugs. /bz -- Bjoern A. Zeeb See you when I see you. From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 12:29:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E3A3106566C; Thu, 29 Apr 2010 12:29:12 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-relay3.uni-muenster.de (ZIVM-RELAY3.UNI-MUENSTER.DE [128.176.192.19]) by mx1.freebsd.org (Postfix) with ESMTP id 8D0CC8FC12; Thu, 29 Apr 2010 12:29:10 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.52,295,1270418400"; d="scan'208";a="32664463" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 29 Apr 2010 14:29:10 +0200 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 78E191B0769; Thu, 29 Apr 2010 14:29:10 +0200 (CEST) Date: Thu, 29 Apr 2010 14:29:09 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Andriy Gapon Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r207330 - head/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 12:29:12 -0000 @Andriy: thanks a lot. very nice of you to mention my name in connection with this commit. :) -- Alexander Best From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 15:19:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FAEE106566C; Thu, 29 Apr 2010 15:19:11 +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 7EF258FC17; Thu, 29 Apr 2010 15:19: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 o3TFJBVI081507; Thu, 29 Apr 2010 15:19:11 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TFJB8A081505; Thu, 29 Apr 2010 15:19:11 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201004291519.o3TFJB8A081505@svn.freebsd.org> From: Rui Paulo Date: Thu, 29 Apr 2010 15:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207370 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 15:19:11 -0000 Author: rpaulo Date: Thu Apr 29 15:19:11 2010 New Revision: 207370 URL: http://svn.freebsd.org/changeset/base/207370 Log: Decrement rxa_pad due to the addition of rxa_private. Modified: head/sys/net80211/ieee80211_ht.h Modified: head/sys/net80211/ieee80211_ht.h ============================================================================== --- head/sys/net80211/ieee80211_ht.h Thu Apr 29 11:52:42 2010 (r207369) +++ head/sys/net80211/ieee80211_ht.h Thu Apr 29 15:19:11 2010 (r207370) @@ -143,7 +143,7 @@ struct ieee80211_rx_ampdu { int rxa_nframes; /* frames since ADDBA */ struct mbuf *rxa_m[IEEE80211_AGGR_BAWMAX]; void *rxa_private; - uint64_t rxa_pad[4]; + uint64_t rxa_pad[3]; }; void ieee80211_ht_attach(struct ieee80211com *); From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 15:23:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FAAB1065670; Thu, 29 Apr 2010 15:23:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A0D038FC0A; Thu, 29 Apr 2010 15:23:25 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o3TFNLY9099345 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 Apr 2010 18:23:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o3TFNL1e063279; Thu, 29 Apr 2010 18:23:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3TFNLJs063278; Thu, 29 Apr 2010 18:23:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Apr 2010 18:23:21 +0300 From: Kostik Belousov To: Rui Paulo Message-ID: <20100429152321.GF2391@deviant.kiev.zoral.com.ua> References: <201004291519.o3TFJB8A081505@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="65ImJOski3p8EhYV" Content-Disposition: inline In-Reply-To: <201004291519.o3TFJB8A081505@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207370 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 15:23:26 -0000 --65ImJOski3p8EhYV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 29, 2010 at 03:19:11PM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Thu Apr 29 15:19:11 2010 > New Revision: 207370 > URL: http://svn.freebsd.org/changeset/base/207370 >=20 > Log: > Decrement rxa_pad due to the addition of rxa_private. If the goal was to keep the size of the struct ieee80211_rx_ampdu as it was before addition of rxa_private, then this commit still did not achieved it on 32bit arches. >=20 > Modified: > head/sys/net80211/ieee80211_ht.h >=20 > Modified: head/sys/net80211/ieee80211_ht.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/net80211/ieee80211_ht.h Thu Apr 29 11:52:42 2010 (r207369) > +++ head/sys/net80211/ieee80211_ht.h Thu Apr 29 15:19:11 2010 (r207370) > @@ -143,7 +143,7 @@ struct ieee80211_rx_ampdu { > int rxa_nframes; /* frames since ADDBA */ > struct mbuf *rxa_m[IEEE80211_AGGR_BAWMAX]; > void *rxa_private; > - uint64_t rxa_pad[4]; > + uint64_t rxa_pad[3]; > }; > =20 > void ieee80211_ht_attach(struct ieee80211com *); --65ImJOski3p8EhYV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkvZpGgACgkQC3+MBN1Mb4hQjQCfd7nA6zZF+mlJ5ZonqZuXGbuQ hOgAniV6U9f9sN30xi0EpkeZWF4NXNyX =ygIn -----END PGP SIGNATURE----- --65ImJOski3p8EhYV-- From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 15:36:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37CFF1065677; Thu, 29 Apr 2010 15:36:33 +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 25E3E8FC23; Thu, 29 Apr 2010 15:36:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3TFaXUN085319; Thu, 29 Apr 2010 15:36:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TFaW19085308; Thu, 29 Apr 2010 15:36:32 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004291536.o3TFaW19085308@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 29 Apr 2010 15:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207371 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 15:36:33 -0000 Author: pjd Date: Thu Apr 29 15:36:32 2010 New Revision: 207371 URL: http://svn.freebsd.org/changeset/base/207371 Log: Fix a problem where hastd will stuck in recv(2) after sending request to secondary, which died between send(2) and recv(2). Do it by adding timeout to recv(2) for primary incoming and outgoing sockets and secondary outgoing socket. Reported by: Mikolaj Golub Tested by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/hast.conf.5 head/sbin/hastd/hast.h head/sbin/hastd/hastd.c head/sbin/hastd/parse.y head/sbin/hastd/primary.c head/sbin/hastd/proto.c head/sbin/hastd/proto.h head/sbin/hastd/proto_common.c head/sbin/hastd/secondary.c head/sbin/hastd/token.l Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Thu Apr 29 15:19:11 2010 (r207370) +++ head/sbin/hastd/hast.conf.5 Thu Apr 29 15:36:32 2010 (r207371) @@ -58,6 +58,7 @@ file is following: control listen replication +timeout on { # Node section @@ -76,6 +77,7 @@ resource { replication name local + timeout on { # Resource-node section @@ -194,6 +196,11 @@ The .Ic async replication mode is currently not implemented. .El +.It Ic timeout Aq seconds +.Pp +Connection timeout in seconds. +The default value is +.Va 5 . .It Ic name Aq name .Pp GEOM provider name that will appear as Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Thu Apr 29 15:19:11 2010 (r207370) +++ head/sbin/hastd/hast.h Thu Apr 29 15:36:32 2010 (r207371) @@ -75,6 +75,7 @@ #define HIO_DELETE 3 #define HIO_FLUSH 4 +#define HAST_TIMEOUT 5 #define HAST_CONFIG "/etc/hast.conf" #define HAST_CONTROL "/var/run/hastctl" #define HASTD_PORT 8457 @@ -148,6 +149,8 @@ struct hast_resource { /* Token to verify both in and out connection are coming from the same node (not necessarily from the same address). */ unsigned char hr_token[HAST_TOKEN_SIZE]; + /* Connection timeout. */ + int hr_timeout; /* Resource unique identifier. */ uint64_t hr_resuid; Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Thu Apr 29 15:19:11 2010 (r207370) +++ head/sbin/hastd/hastd.c Thu Apr 29 15:36:32 2010 (r207371) @@ -187,6 +187,10 @@ listen_accept(void) proto_remote_address(conn, raddr, sizeof(raddr)); pjdlog_info("Connection from %s to %s.", laddr, raddr); + /* Error in setting timeout is not critical, but why should it fail? */ + if (proto_timeout(conn, HAST_TIMEOUT) < 0) + pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); + nvin = nvout = nverr = NULL; /* Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Thu Apr 29 15:19:11 2010 (r207370) +++ head/sbin/hastd/parse.y Thu Apr 29 15:36:32 2010 (r207371) @@ -58,6 +58,7 @@ static bool mynode; static char depth0_control[HAST_ADDRSIZE]; static char depth0_listen[HAST_ADDRSIZE]; static int depth0_replication; +static int depth0_timeout; static char depth1_provname[PATH_MAX]; static char depth1_localpath[PATH_MAX]; @@ -115,6 +116,7 @@ yy_config_parse(const char *config) curres = NULL; mynode = false; + depth0_timeout = HAST_TIMEOUT; depth0_replication = HAST_REPLICATION_MEMSYNC; strlcpy(depth0_control, HAST_CONTROL, sizeof(depth0_control)); strlcpy(depth0_listen, HASTD_LISTEN, sizeof(depth0_listen)); @@ -154,6 +156,13 @@ yy_config_parse(const char *config) */ curres->hr_replication = depth0_replication; } + if (curres->hr_timeout == -1) { + /* + * Timeout is not set at resource-level. + * Use global or default setting. + */ + curres->hr_timeout = depth0_timeout; + } } return (&lconfig); @@ -171,7 +180,7 @@ yy_config_free(struct hastd_config *conf } %} -%token CONTROL LISTEN PORT REPLICATION EXTENTSIZE RESOURCE NAME LOCAL REMOTE ON +%token CONTROL LISTEN PORT REPLICATION TIMEOUT EXTENTSIZE RESOURCE NAME LOCAL REMOTE ON %token FULLSYNC MEMSYNC ASYNC %token NUM STR OB CB @@ -200,6 +209,8 @@ statement: | replication_statement | + timeout_statement + | node_statement | resource_statement @@ -281,6 +292,22 @@ replication_type: ASYNC { $$ = HAST_REPLICATION_ASYNC; } ; +timeout_statement: TIMEOUT NUM + { + switch (depth) { + case 0: + depth0_timeout = $2; + break; + case 1: + if (curres != NULL) + curres->hr_timeout = $2; + break; + default: + assert(!"timeout at wrong depth level"); + } + } + ; + node_statement: ON node_start OB node_entries CB { mynode = false; @@ -389,6 +416,7 @@ resource_start: STR curres->hr_role = HAST_ROLE_INIT; curres->hr_previous_role = HAST_ROLE_INIT; curres->hr_replication = -1; + curres->hr_timeout = -1; curres->hr_provname[0] = '\0'; curres->hr_localpath[0] = '\0'; curres->hr_localfd = -1; @@ -405,6 +433,8 @@ resource_entries: resource_entry: replication_statement | + timeout_statement + | name_statement | local_statement Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Thu Apr 29 15:19:11 2010 (r207370) +++ head/sbin/hastd/primary.c Thu Apr 29 15:36:32 2010 (r207371) @@ -489,6 +489,9 @@ init_remote(struct hast_resource *res, s res->hr_remoteaddr); goto close; } + /* Error in setting timeout is not critical, but why should it fail? */ + if (proto_timeout(out, res->hr_timeout) < 0) + pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); /* * First handshake step. * Setup outgoing connection with remote node. @@ -552,6 +555,9 @@ init_remote(struct hast_resource *res, s res->hr_remoteaddr); goto close; } + /* Error in setting timeout is not critical, but why should it fail? */ + if (proto_timeout(in, res->hr_timeout) < 0) + pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); nvout = nv_alloc(); nv_add_string(nvout, res->hr_name, "resource"); nv_add_uint8_array(nvout, res->hr_token, sizeof(res->hr_token), Modified: head/sbin/hastd/proto.c ============================================================================== --- head/sbin/hastd/proto.c Thu Apr 29 15:19:11 2010 (r207370) +++ head/sbin/hastd/proto.c Thu Apr 29 15:36:32 2010 (r207371) @@ -30,7 +30,9 @@ #include __FBSDID("$FreeBSD$"); +#include #include +#include #include #include @@ -247,6 +249,30 @@ proto_remote_address(const struct proto_ conn->pc_proto->hp_remote_address(conn->pc_ctx, addr, size); } +int +proto_timeout(const struct proto_conn *conn, int timeout) +{ + struct timeval tv; + int fd; + + assert(conn != NULL); + assert(conn->pc_magic == PROTO_CONN_MAGIC); + assert(conn->pc_proto != NULL); + + fd = proto_descriptor(conn); + if (fd < 0) + return (-1); + + tv.tv_sec = timeout; + tv.tv_usec = 0; + if (setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)) < 0) + return (-1); + if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0) + return (-1); + + return (0); +} + void proto_close(struct proto_conn *conn) { Modified: head/sbin/hastd/proto.h ============================================================================== --- head/sbin/hastd/proto.h Thu Apr 29 15:19:11 2010 (r207370) +++ head/sbin/hastd/proto.h Thu Apr 29 15:36:32 2010 (r207371) @@ -49,6 +49,7 @@ void proto_local_address(const struct pr size_t size); void proto_remote_address(const struct proto_conn *conn, char *addr, size_t size); +int proto_timeout(const struct proto_conn *conn, int timeout); void proto_close(struct proto_conn *conn); #endif /* !_PROTO_H_ */ Modified: head/sbin/hastd/proto_common.c ============================================================================== --- head/sbin/hastd/proto_common.c Thu Apr 29 15:19:11 2010 (r207370) +++ head/sbin/hastd/proto_common.c Thu Apr 29 15:36:32 2010 (r207371) @@ -58,7 +58,7 @@ proto_common_send(int fd, const unsigned if (done == 0) return (ENOTCONN); else if (done < 0) { - if (errno == EAGAIN) + if (errno == EINTR) continue; return (errno); } @@ -76,7 +76,7 @@ proto_common_recv(int fd, unsigned char do { done = recv(fd, data, size, MSG_WAITALL); - } while (done == -1 && errno == EAGAIN); + } while (done == -1 && errno == EINTR); if (done == 0) return (ENOTCONN); else if (done < 0) Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Thu Apr 29 15:19:11 2010 (r207370) +++ head/sbin/hastd/secondary.c Thu Apr 29 15:36:32 2010 (r207371) @@ -337,6 +337,12 @@ hastd_secondary(struct hast_resource *re setproctitle("%s (secondary)", res->hr_name); + /* Error in setting timeout is not critical, but why should it fail? */ + if (proto_timeout(res->hr_remotein, 0) < 0) + pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); + if (proto_timeout(res->hr_remoteout, res->hr_timeout) < 0) + pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); + init_local(res); init_remote(res, nvin); init_environment(); Modified: head/sbin/hastd/token.l ============================================================================== --- head/sbin/hastd/token.l Thu Apr 29 15:19:11 2010 (r207370) +++ head/sbin/hastd/token.l Thu Apr 29 15:36:32 2010 (r207371) @@ -48,6 +48,7 @@ control { DP; return CONTROL; } listen { DP; return LISTEN; } port { DP; return PORT; } replication { DP; return REPLICATION; } +timeout { DP; return TIMEOUT; } resource { DP; return RESOURCE; } name { DP; return NAME; } local { DP; return LOCAL; } From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 15:42:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F88C106566B; Thu, 29 Apr 2010 15:42:24 +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 7569F8FC14; Thu, 29 Apr 2010 15: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 o3TFgOLP086616; Thu, 29 Apr 2010 15:42:24 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TFgOiR086614; Thu, 29 Apr 2010 15:42:24 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004291542.o3TFgOiR086614@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 29 Apr 2010 15:42: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: r207372 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 15:42:24 -0000 Author: pjd Date: Thu Apr 29 15:42:24 2010 New Revision: 207372 URL: http://svn.freebsd.org/changeset/base/207372 Log: - Check if the worker process was killed by signal and restart it. - Improve logging. Pointed out by: Garrett Cooper MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Thu Apr 29 15:36:32 2010 (r207371) +++ head/sbin/hastd/hastd.c Thu Apr 29 15:42:24 2010 (r207372) @@ -108,6 +108,22 @@ g_gate_load(void) } static void +child_exit_log(unsigned int pid, int status) +{ + + if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { + pjdlog_debug(1, "Worker process exited gracefully (pid=%u).", + pid); + } else if (WIFSIGNALED(status)) { + pjdlog_error("Worker process killed (pid=%u, signal=%d).", + pid, WTERMSIG(status)); + } else { + pjdlog_error("Worker process exited ungracefully (pid=%u, exitcode=%d).", + pid, WIFEXITED(status) ? WEXITSTATUS(status) : -1); + } +} + +static void child_exit(void) { struct hast_resource *res; @@ -129,18 +145,17 @@ child_exit(void) } pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); - if (WEXITSTATUS(status) == 0) { - pjdlog_debug(1, - "Worker process exited gracefully (pid=%u).", - (unsigned int)pid); - } else { - pjdlog_error("Worker process failed (pid=%u, status=%d).", - (unsigned int)pid, WEXITSTATUS(status)); - } + child_exit_log(pid, status); proto_close(res->hr_ctrl); res->hr_workerpid = 0; if (res->hr_role == HAST_ROLE_PRIMARY) { - if (WEXITSTATUS(status) == EX_TEMPFAIL) { + /* + * Restart child process if it was killed by signal + * or exited because of temporary problem. + */ + if (WIFSIGNALED(status) || + (WIFEXITED(status) && + WEXITSTATUS(status) == EX_TEMPFAIL)) { sleep(1); pjdlog_info("Restarting worker process."); hastd_primary(res); @@ -300,19 +315,12 @@ listen_accept(void) /* Wait for it to exit. */ else if ((pid = waitpid(res->hr_workerpid, &status, 0)) != res->hr_workerpid) { + /* We can only log the problem. */ pjdlog_errno(LOG_ERR, "Waiting for worker process (pid=%u) failed", (unsigned int)res->hr_workerpid); - /* See above. */ - } else if (WEXITSTATUS(status) != 0) { - pjdlog_error("Worker process (pid=%u) exited ungracefully: status=%d.", - (unsigned int)res->hr_workerpid, - WEXITSTATUS(status)); - /* See above. */ } else { - pjdlog_debug(1, - "Worker process (pid=%u) exited gracefully.", - (unsigned int)res->hr_workerpid); + child_exit_log(res->hr_workerpid, status); } res->hr_workerpid = 0; } else if (res->hr_remotein != NULL) { From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 15:47:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C757A106566B; Thu, 29 Apr 2010 15:47:31 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C8A28FC1D; Thu, 29 Apr 2010 15:47:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3TFlVo8087770; Thu, 29 Apr 2010 15:47:31 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TFlVvK087766; Thu, 29 Apr 2010 15:47:31 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004291547.o3TFlVvK087766@svn.freebsd.org> From: Alan Cox Date: Thu, 29 Apr 2010 15:47: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: r207373 - in head/sys: ia64/ia64 sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 15:47:31 -0000 Author: alc Date: Thu Apr 29 15:47:31 2010 New Revision: 207373 URL: http://svn.freebsd.org/changeset/base/207373 Log: MFamd64/i386 r207205 Clearing a page table entry's accessed bit and setting the page's PG_REFERENCED flag in pmap_protect() can't really be justified, so don't do it. Moreover, on ia64, don't set the page's dirty field unless pmap_protect() is removing write access. Modified: head/sys/ia64/ia64/pmap.c head/sys/sparc64/sparc64/pmap.c head/sys/sun4v/sun4v/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Thu Apr 29 15:42:24 2010 (r207372) +++ head/sys/ia64/ia64/pmap.c Thu Apr 29 15:47:31 2010 (r207373) @@ -1450,19 +1450,13 @@ pmap_protect(pmap_t pmap, vm_offset_t sv if (pmap_prot(pte) == prot) continue; - if (pmap_managed(pte)) { - vm_offset_t pa = pmap_ppn(pte); + if ((prot & VM_PROT_WRITE) == 0 && + pmap_managed(pte) && pmap_dirty(pte)) { + vm_paddr_t pa = pmap_ppn(pte); vm_page_t m = PHYS_TO_VM_PAGE(pa); - if (pmap_dirty(pte)) { - vm_page_dirty(m); - pmap_clear_dirty(pte); - } - - if (pmap_accessed(pte)) { - vm_page_flag_set(m, PG_REFERENCED); - pmap_clear_accessed(pte); - } + vm_page_dirty(m); + pmap_clear_dirty(pte); } if (prot & VM_PROT_EXECUTE) Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Thu Apr 29 15:42:24 2010 (r207372) +++ head/sys/sparc64/sparc64/pmap.c Thu Apr 29 15:47:31 2010 (r207373) @@ -1273,13 +1273,10 @@ pmap_protect_tte(struct pmap *pm, struct u_long data; vm_page_t m; - data = atomic_clear_long(&tp->tte_data, TD_REF | TD_SW | TD_W); - if ((data & TD_PV) != 0) { + data = atomic_clear_long(&tp->tte_data, TD_SW | TD_W); + if ((data & (TD_PV | TD_W)) == (TD_PV | TD_W)) { m = PHYS_TO_VM_PAGE(TD_PA(data)); - if ((data & TD_REF) != 0) - vm_page_flag_set(m, PG_REFERENCED); - if ((data & TD_W) != 0) - vm_page_dirty(m); + vm_page_dirty(m); } return (1); } Modified: head/sys/sun4v/sun4v/pmap.c ============================================================================== --- head/sys/sun4v/sun4v/pmap.c Thu Apr 29 15:42:24 2010 (r207372) +++ head/sys/sun4v/sun4v/pmap.c Thu Apr 29 15:47:31 2010 (r207373) @@ -1824,17 +1824,10 @@ pmap_protect(pmap_t pmap, vm_offset_t sv if (!anychanged && (otte_data & VTD_W)) anychanged = 1; - if (otte_data & VTD_MANAGED) { - m = NULL; - - if (otte_data & VTD_REF) { - m = PHYS_TO_VM_PAGE(TTE_GET_PA(otte_data)); - vm_page_flag_set(m, PG_REFERENCED); - } - if (otte_data & VTD_W) { - m = PHYS_TO_VM_PAGE(TTE_GET_PA(otte_data)); - vm_page_dirty(m); - } + if ((otte_data & (VTD_MANAGED | VTD_W)) == (VTD_MANAGED | + VTD_W)) { + m = PHYS_TO_VM_PAGE(TTE_GET_PA(otte_data)); + vm_page_dirty(m); } } From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 16:18:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFB70106564A; Thu, 29 Apr 2010 16:18:45 +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 8523F8FC08; Thu, 29 Apr 2010 16:18: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 o3TGIj3Q094709; Thu, 29 Apr 2010 16:18:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TGIjjo094707; Thu, 29 Apr 2010 16:18:45 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004291618.o3TGIjjo094707@svn.freebsd.org> From: Alan Cox Date: Thu, 29 Apr 2010 16:18: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: r207374 - 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: Thu, 29 Apr 2010 16:18:45 -0000 Author: alc Date: Thu Apr 29 16:18:45 2010 New Revision: 207374 URL: http://svn.freebsd.org/changeset/base/207374 Log: Simplify the inner loop of vm_pageout_object_deactivate_pages(). Rather than checking each page for PG_UNMANAGED, check the vm object's type. Only OBJT_PHYS can have unmanaged pages. Eliminate a pointless counter. The vm object is locked, that lock is never released by the inner loop, and the set of pages contained by the vm object is not changed by the inner loop. Therefore, the counter serves no purpose. Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Apr 29 15:47:31 2010 (r207373) +++ head/sys/vm/vm_pageout.c Thu Apr 29 16:18:45 2010 (r207374) @@ -508,17 +508,16 @@ vm_pageout_object_deactivate_pages(pmap, { vm_object_t backing_object, object; vm_page_t p, next; - int actcount, rcount, remove_mode; + int actcount, remove_mode; VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); if (first_object->type == OBJT_DEVICE || - first_object->type == OBJT_SG || - first_object->type == OBJT_PHYS) + first_object->type == OBJT_SG) return; for (object = first_object;; object = backing_object) { if (pmap_resident_count(pmap) <= desired) goto unlock_return; - if (object->paging_in_progress) + if (object->type == OBJT_PHYS || object->paging_in_progress) goto unlock_return; remove_mode = 0; @@ -527,10 +526,9 @@ vm_pageout_object_deactivate_pages(pmap, /* * scan the objects entire memory queue */ - rcount = object->resident_page_count; p = TAILQ_FIRST(&object->memq); vm_page_lock_queues(); - while (p && (rcount-- > 0)) { + while (p != NULL) { if (pmap_resident_count(pmap) <= desired) { vm_page_unlock_queues(); goto unlock_return; @@ -541,7 +539,6 @@ vm_pageout_object_deactivate_pages(pmap, p->hold_count != 0 || p->busy != 0 || (p->oflags & VPO_BUSY) || - (p->flags & PG_UNMANAGED) || !pmap_page_exists_quick(pmap, p)) { p = next; continue; From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 17:28:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38E751065676; Thu, 29 Apr 2010 17:28:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EA1D8FC14; Thu, 29 Apr 2010 17:28: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 o3THS7hC010112; Thu, 29 Apr 2010 17:28:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3THS7wT010111; Thu, 29 Apr 2010 17:28:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004291728.o3THS7wT010111@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 29 Apr 2010 17:28: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: r207375 - head/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 17:28:08 -0000 Author: yongari Date: Thu Apr 29 17:28:07 2010 New Revision: 207375 URL: http://svn.freebsd.org/changeset/base/207375 Log: Preserve unknown bits of RX MAC control register when driver programs RX filter configuration. It seems RX MAC control register is one of key registers to get various offloading features as well as performance. Blindly clearing unrelated bits can result in unexpected results. Tested by: xclin cs dot nctu dot edu dot tw > Modified: head/sys/dev/sge/if_sge.c Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Thu Apr 29 16:18:45 2010 (r207374) +++ head/sys/dev/sge/if_sge.c Thu Apr 29 17:28:07 2010 (r207375) @@ -453,8 +453,9 @@ sge_rxfilter(struct sge_softc *sc) SGE_LOCK_ASSERT(sc); ifp = sc->sge_ifp; - hashes[0] = hashes[1] = 0; - rxfilt = AcceptMyPhys; + rxfilt = CSR_READ_2(sc, RxMacControl); + rxfilt &= ~(AcceptBroadcast | AcceptAllPhys | AcceptMulticast); + rxfilt |= AcceptMyPhys; if ((ifp->if_flags & IFF_BROADCAST) != 0) rxfilt |= AcceptBroadcast; if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { @@ -463,20 +464,20 @@ sge_rxfilter(struct sge_softc *sc) rxfilt |= AcceptMulticast; hashes[0] = 0xFFFFFFFF; hashes[1] = 0xFFFFFFFF; - goto done; - } - rxfilt |= AcceptMulticast; - /* Now program new ones. */ - if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) - ifma->ifma_addr), ETHER_ADDR_LEN); - hashes[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); + } else { + rxfilt |= AcceptMulticast; + hashes[0] = hashes[1] = 0; + /* Now program new ones. */ + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN); + hashes[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); + } + if_maddr_runlock(ifp); } - if_maddr_runlock(ifp); -done: CSR_WRITE_2(sc, RxMacControl, rxfilt | 0x02); CSR_WRITE_4(sc, RxHashTable, hashes[0]); CSR_WRITE_4(sc, RxHashTable2, hashes[1]); From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 17:30:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0F8F106564A; Thu, 29 Apr 2010 17:30:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E01738FC14; Thu, 29 Apr 2010 17:30:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3THULQs010646; Thu, 29 Apr 2010 17:30:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3THULmi010644; Thu, 29 Apr 2010 17:30:21 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004291730.o3THULmi010644@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 29 Apr 2010 17:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207376 - head/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 17:30:22 -0000 Author: yongari Date: Thu Apr 29 17:30:21 2010 New Revision: 207376 URL: http://svn.freebsd.org/changeset/base/207376 Log: Remove wrong link state chage. Modified: head/sys/dev/sge/if_sge.c Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Thu Apr 29 17:28:07 2010 (r207375) +++ head/sys/dev/sge/if_sge.c Thu Apr 29 17:30:21 2010 (r207376) @@ -1591,7 +1591,6 @@ sge_ifmedia_upd(struct ifnet *ifp) sc = ifp->if_softc; SGE_LOCK(sc); mii = device_get_softc(sc->sge_miibus); - sc->sge_flags &= ~SGE_FLAG_LINK; if (mii->mii_instance) { struct mii_softc *miisc; LIST_FOREACH(miisc, &mii->mii_phys, mii_list) From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 17:34:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F909106566C; Thu, 29 Apr 2010 17:34:02 +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 0EEE58FC1D; Thu, 29 Apr 2010 17:34: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 o3THY1Kx011510; Thu, 29 Apr 2010 17:34:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3THY1NL011507; Thu, 29 Apr 2010 17:34:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004291734.o3THY1NL011507@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 29 Apr 2010 17: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: r207377 - head/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 17:34:02 -0000 Author: yongari Date: Thu Apr 29 17:34:01 2010 New Revision: 207377 URL: http://svn.freebsd.org/changeset/base/207377 Log: Explicitly marks SiS190 to differentiate it from SiS191. Modified: head/sys/dev/sge/if_sge.c head/sys/dev/sge/if_sgereg.h Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Thu Apr 29 17:30:21 2010 (r207376) +++ head/sys/dev/sge/if_sge.c Thu Apr 29 17:34:01 2010 (r207377) @@ -572,7 +572,7 @@ sge_attach(device_t dev) } sc->sge_rev = pci_get_revid(dev); if (pci_get_device(dev) == SIS_DEVICEID_190) - sc->sge_flags |= SGE_FLAG_FASTETHER; + sc->sge_flags |= SGE_FLAG_FASTETHER | SGE_FLAG_SIS190; /* Reset the adapter. */ sge_reset(sc); Modified: head/sys/dev/sge/if_sgereg.h ============================================================================== --- head/sys/dev/sge/if_sgereg.h Thu Apr 29 17:30:21 2010 (r207376) +++ head/sys/dev/sge/if_sgereg.h Thu Apr 29 17:34:01 2010 (r207377) @@ -331,6 +331,7 @@ struct sge_softc { int sge_timer; int sge_flags; #define SGE_FLAG_FASTETHER 0x0001 +#define SGE_FLAG_SIS190 0x0002 #define SGE_FLAG_RGMII 0x0010 #define SGE_FLAG_SPEED_1000 0x2000 #define SGE_FLAG_FDX 0x4000 From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 17:51:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55C57106564A; Thu, 29 Apr 2010 17:51:07 +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 44D418FC17; Thu, 29 Apr 2010 17:51: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 o3THp7ZJ015274; Thu, 29 Apr 2010 17:51:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3THp7Qm015271; Thu, 29 Apr 2010 17:51:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004291751.o3THp7Qm015271@svn.freebsd.org> From: Xin LI Date: Thu, 29 Apr 2010 17:51:07 +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: r207378 - 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: Thu, 29 Apr 2010 17:51:07 -0000 Author: delphij Date: Thu Apr 29 17:51:06 2010 New Revision: 207378 URL: http://svn.freebsd.org/changeset/base/207378 Log: Please welcome Martin Matuska (mm@) to src/ committer's rank. I'll be his mentor. Martin have some in-progress ZFS work that is intended for MFC to -STABLE branches. Being working on ZFS with Pawel and me for a while, he got the usual charge. Approved by: core@ Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Apr 29 17:34:01 2010 (r207377) +++ svnadmin/conf/access Thu Apr 29 17:51:06 2010 (r207378) @@ -147,6 +147,7 @@ mckusick mdodd mjacob mlaier +mm mohans motoyuki mp Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Apr 29 17:34:01 2010 (r207377) +++ svnadmin/conf/mentors Thu Apr 29 17:51:06 2010 (r207378) @@ -18,6 +18,7 @@ dchagin kib eri mlaier Co-mentor: thompsa gabor delphij jinmei gnn +mm delphij nork imp randi cperciva rdivacky ed From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 18:00:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBCBD106567A; Thu, 29 Apr 2010 18:00:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA7DD8FC27; Thu, 29 Apr 2010 18:00:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3TI0gYU017429; Thu, 29 Apr 2010 18:00:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TI0gD9017426; Thu, 29 Apr 2010 18:00:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004291800.o3TI0gD9017426@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 29 Apr 2010 18:00: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: r207379 - head/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 18:00:43 -0000 Author: yongari Date: Thu Apr 29 18:00:42 2010 New Revision: 207379 URL: http://svn.freebsd.org/changeset/base/207379 Log: Enable FCS stripping and padding 10 bytes bit of RX MAC control register. Due to lack of SiS190 controller, I'm not sure whether this is also applicable to SiS190 so this feature is only activated on SiS191 controller. The controller can pad 10 bytes before DMAing a received frame to RX buffer and received bytes include the padded bytes. This padding is very useful on strict-alignment architectures because driver does not have to copy received frame to align IP header on 4 bytes boundary. It also gives better RX performance on non-strict alignment architectures. Special thanks to xclin to give me valuable register information. Without his enthusiastic trial and errors this wouldn't be even possible. While I'm here tighten validity check of received frame. Controller clears RDS_CRCOK bit when it received bad CRC frames. xclin found that using loop back testing. Tested by: xclin cs dot nctu dot edu dot tw > Modified: head/sys/dev/sge/if_sge.c head/sys/dev/sge/if_sgereg.h Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Thu Apr 29 17:51:06 2010 (r207378) +++ head/sys/dev/sge/if_sge.c Thu Apr 29 18:00:42 2010 (r207379) @@ -1144,7 +1144,8 @@ sge_rxeof(struct sge_softc *sc) if ((rxinfo & RDC_OWN) != 0) break; rxstat = le32toh(cur_rx->sge_sts_size); - if (SGE_RX_ERROR(rxstat) != 0 || SGE_RX_NSEGS(rxstat) != 1) { + if ((rxstat & RDS_CRCOK) == 0 || SGE_RX_ERROR(rxstat) != 0 || + SGE_RX_NSEGS(rxstat) != 1) { /* XXX We don't support multi-segment frames yet. */ #ifdef SGE_SHOW_ERRORS device_printf(sc->sge_dev, "Rx error : 0x%b\n", rxstat, @@ -1177,11 +1178,23 @@ sge_rxeof(struct sge_softc *sc) /* * TODO : VLAN hardware tag stripping. */ - m->m_pkthdr.len = m->m_len = - SGE_RX_BYTES(rxstat) - ETHER_CRC_LEN; + if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) { + /* + * Account for 10bytes auto padding which is used + * to align IP header on 32bit boundary. Also note, + * CRC bytes is automatically removed by the + * hardware. + */ + m->m_data += SGE_RX_PAD_BYTES; + m->m_pkthdr.len = m->m_len = SGE_RX_BYTES(rxstat) - + SGE_RX_PAD_BYTES; + } else { + m->m_pkthdr.len = m->m_len = SGE_RX_BYTES(rxstat) - + ETHER_CRC_LEN; #ifndef __NO_STRICT_ALIGNMENT - sge_fixup_rx(m); + sge_fixup_rx(m); #endif + } m->m_pkthdr.rcvif = ifp; ifp->if_ipackets++; SGE_UNLOCK(sc); @@ -1503,6 +1516,7 @@ sge_init_locked(struct sge_softc *sc) { struct ifnet *ifp; struct mii_data *mii; + uint16_t rxfilt; int i; SGE_LOCK_ASSERT(sc); @@ -1535,10 +1549,19 @@ sge_init_locked(struct sge_softc *sc) CSR_WRITE_4(sc, RxWakeOnLan, 0); CSR_WRITE_4(sc, RxWakeOnLanData, 0); /* Allow receiving VLAN frames. */ - CSR_WRITE_2(sc, RxMPSControl, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); + if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) + CSR_WRITE_2(sc, RxMPSControl, + ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + SGE_RX_PAD_BYTES); + else + CSR_WRITE_2(sc, RxMPSControl, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); for (i = 0; i < ETHER_ADDR_LEN; i++) CSR_WRITE_1(sc, RxMacAddr + i, IF_LLADDR(ifp)[i]); + /* Configure RX MAC. */ + rxfilt = 0; + if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) + rxfilt |= RXMAC_STRIP_FCS | RXMAC_PAD_ENB; + CSR_WRITE_2(sc, RxMacControl, rxfilt); sge_rxfilter(sc); /* Initialize default speed/duplex information. */ Modified: head/sys/dev/sge/if_sgereg.h ============================================================================== --- head/sys/dev/sge/if_sgereg.h Thu Apr 29 17:51:06 2010 (r207378) +++ head/sys/dev/sge/if_sgereg.h Thu Apr 29 18:00:42 2010 (r207379) @@ -137,6 +137,10 @@ #define AcceptAllPhys 0x0100 #define AcceptErr 0x0020 #define AcceptRunt 0x0010 +#define RXMAC_STRIP_FCS 0x0010 +#define RXMAC_PAD_ENB 0x0004 + +#define SGE_RX_PAD_BYTES 10 /* Station control register. */ #define SC_LOOPBACK 0x80000000 From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 18:14:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B82ED1065670; Thu, 29 Apr 2010 18:14:14 +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 A6D498FC08; Thu, 29 Apr 2010 18:14: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 o3TIEEkS020597; Thu, 29 Apr 2010 18:14:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TIEE7S020594; Thu, 29 Apr 2010 18:14:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004291814.o3TIEE7S020594@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 29 Apr 2010 18:14: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: r207380 - head/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 18:14:14 -0000 Author: yongari Date: Thu Apr 29 18:14:14 2010 New Revision: 207380 URL: http://svn.freebsd.org/changeset/base/207380 Log: Enable VLAN hardware tag insertion/stripping. Due to lack of SiS190 controller, I'm not sure whether this is also applicable to SiS190 so this feature is only activated on SiS191 controller. In theory, controller reinitialization is not needed when VLAN tag configuration is changed, but xclin said controller was not stable whenever toggling VLAN tag bit. To address that, sge(4) reinitialize controller for VLAN configuration which seems to work as expected. VLAN tag information for TX/RX descriptor and configure bit of RxMacControl register was found by xclin. Submitted by: xclin cs dot nctu dot edu dot tw > (initial version) Tested by: xclin cs dot nctu dot edu dot tw > Modified: head/sys/dev/sge/if_sge.c head/sys/dev/sge/if_sgereg.h Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Thu Apr 29 18:00:42 2010 (r207379) +++ head/sys/dev/sge/if_sge.c Thu Apr 29 18:14:14 2010 (r207380) @@ -137,6 +137,7 @@ static int sge_get_mac_addr_eeprom(struc static uint16_t sge_read_eeprom(struct sge_softc *, int); static void sge_rxfilter(struct sge_softc *); +static void sge_setvlan(struct sge_softc *); static void sge_reset(struct sge_softc *); static int sge_list_rx_init(struct sge_softc *); static int sge_list_rx_free(struct sge_softc *); @@ -484,6 +485,25 @@ sge_rxfilter(struct sge_softc *sc) } static void +sge_setvlan(struct sge_softc *sc) +{ + struct ifnet *ifp; + uint16_t rxfilt; + + SGE_LOCK_ASSERT(sc); + + ifp = sc->sge_ifp; + if ((ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) == 0) + return; + rxfilt = CSR_READ_2(sc, RxMacControl); + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) + rxfilt |= RXMAC_STRIP_VLAN; + else + rxfilt &= ~RXMAC_STRIP_VLAN; + CSR_WRITE_2(sc, RxMacControl, rxfilt); +} + +static void sge_reset(struct sge_softc *sc) { @@ -619,6 +639,9 @@ sge_attach(device_t dev) ether_ifattach(ifp, eaddr); /* VLAN setup. */ + if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM; ifp->if_capabilities |= IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; /* Tell the upper layer(s) we support long frames. */ @@ -1175,9 +1198,12 @@ sge_rxeof(struct sge_softc *sc) m->m_pkthdr.csum_data = 0xffff; } } - /* - * TODO : VLAN hardware tag stripping. - */ + /* Check for VLAN tagged frame. */ + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0 && + (rxstat & RDS_VLAN) != 0) { + m->m_pkthdr.ether_vtag = rxinfo & RDC_VLAN_MASK; + m->m_flags |= M_VLANTAG; + } if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) { /* * Account for 10bytes auto padding which is used @@ -1422,6 +1448,11 @@ sge_encap(struct sge_softc *sc, struct m desc->sge_flags = htole32(txsegs[0].ds_len); if (prod == SGE_TX_RING_CNT - 1) desc->sge_flags |= htole32(RING_END); + /* Configure VLAN. */ + if(((*m_head)->m_flags & M_VLANTAG) != 0) { + cflags |= (*m_head)->m_pkthdr.ether_vtag; + desc->sge_sts_size |= htole32(TDS_INS_VLAN); + } desc->sge_cmdsts = htole32(TDC_DEF | TDC_CRC | TDC_PAD | cflags); #if 1 if ((sc->sge_flags & SGE_FLAG_SPEED_1000) != 0) @@ -1563,6 +1594,7 @@ sge_init_locked(struct sge_softc *sc) rxfilt |= RXMAC_STRIP_FCS | RXMAC_PAD_ENB; CSR_WRITE_2(sc, RxMacControl, rxfilt); sge_rxfilter(sc); + sge_setvlan(sc); /* Initialize default speed/duplex information. */ if ((sc->sge_flags & SGE_FLAG_FASTETHER) == 0) @@ -1653,7 +1685,7 @@ sge_ioctl(struct ifnet *ifp, u_long comm struct sge_softc *sc; struct ifreq *ifr; struct mii_data *mii; - int error = 0, mask; + int error = 0, mask, reinit; sc = ifp->if_softc; ifr = (struct ifreq *)data; @@ -1675,6 +1707,7 @@ sge_ioctl(struct ifnet *ifp, u_long comm break; case SIOCSIFCAP: SGE_LOCK(sc); + reinit = 0; mask = ifr->ifr_reqcap ^ ifp->if_capenable; if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { @@ -1687,7 +1720,24 @@ sge_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_VLAN_HWCSUM) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { + /* + * Due to unknown reason, toggling VLAN hardware + * tagging require interface reinitialization. + */ + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + reinit = 1; + } + if (reinit > 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + sge_init_locked(sc); + } SGE_UNLOCK(sc); + VLAN_CAPABILITIES(ifp); break; case SIOCADDMULTI: case SIOCDELMULTI: Modified: head/sys/dev/sge/if_sgereg.h ============================================================================== --- head/sys/dev/sge/if_sgereg.h Thu Apr 29 18:00:42 2010 (r207379) +++ head/sys/dev/sge/if_sgereg.h Thu Apr 29 18:14:14 2010 (r207380) @@ -137,6 +137,7 @@ #define AcceptAllPhys 0x0100 #define AcceptErr 0x0020 #define AcceptRunt 0x0010 +#define RXMAC_STRIP_VLAN 0x0020 #define RXMAC_STRIP_FCS 0x0010 #define RXMAC_PAD_ENB 0x0004 @@ -187,12 +188,14 @@ #define TDC_COL 0x00040000 #define TDC_CRC 0x00020000 #define TDC_PAD 0x00010000 +#define TDC_VLAN_MASK 0x0000FFFF #define SGE_TX_INTR_FRAMES 32 /* * TX descriptor status bits. */ +#define TDS_INS_VLAN 0x80000000 #define TDS_OWC 0x00080000 #define TDS_ABT 0x00040000 #define TDS_FIFO 0x00020000 @@ -219,11 +222,12 @@ #define RDC_UCAST 0x00040000 #define RDC_CRCOFF 0x00020000 #define RDC_PREADD 0x00010000 +#define RDC_VLAN_MASK 0x0000FFFF /* * RX descriptor status bits */ -#define RDS_TAGON 0x80000000 +#define RDS_VLAN 0x80000000 #define RDS_DESCS 0x3f000000 #define RDS_ABORT 0x00800000 #define RDS_SHORT 0x00400000 @@ -240,7 +244,7 @@ #define RX_ERR_BITS "\20" \ "\21CRCOK\22COLON\23NIBON\24OVRUN" \ "\25MIIER\26LIMIT\27SHORT\30ABORT" \ - "\40TAGON" + "\40VLAN" #define RING_END 0x80000000 #define SGE_RX_BYTES(x) ((x) & 0xFFFF) From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 18:21:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B459F106566B; Thu, 29 Apr 2010 18:21:27 +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 A348C8FC17; Thu, 29 Apr 2010 18:21: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 o3TILROq022201; Thu, 29 Apr 2010 18:21:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TILRKf022198; Thu, 29 Apr 2010 18:21:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004291821.o3TILRKf022198@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 29 Apr 2010 18:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207381 - 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: Thu, 29 Apr 2010 18:21:27 -0000 Author: yongari Date: Thu Apr 29 18:21:27 2010 New Revision: 207381 URL: http://svn.freebsd.org/changeset/base/207381 Log: Now sge(4) supports hardware VLAN tag insertion/stripping. Modified: head/share/man/man4/sge.4 head/share/man/man4/vlan.4 Modified: head/share/man/man4/sge.4 ============================================================================== --- head/share/man/man4/sge.4 Thu Apr 29 18:14:14 2010 (r207380) +++ head/share/man/man4/sge.4 Thu Apr 29 18:21:27 2010 (r207381) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2010 +.Dd April 29, 2010 .Dt SGE 4 .Os .Sh NAME @@ -53,11 +53,11 @@ controllers and SiS191 Fast/Gigabit Ethe .Pp All LOMs supported by the .Nm -driver have TCP/UDP/IP checksum offload for transmit and receive. +driver have TCP/UDP/IP checksum offload for transmit and receive, +hardware VLAN tag stripping/insertion features. Due to lack of documentation more offloading features like TCP -segmentation offload (TSO), hardware VLAN tag stripping/insertion -features, Wake On Lan (WOL), Jumbo frame and an interrupt moderation -mechanism are not supported yet. +segmentation offload (TSO), Wake On Lan (WOL), Jumbo frame and an +interrupt moderation mechanism are not supported yet. .Pp The .Nm Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Thu Apr 29 18:14:14 2010 (r207380) +++ head/share/man/man4/vlan.4 Thu Apr 29 18:21:27 2010 (r207381) @@ -134,6 +134,7 @@ in the hardware is limited to the follow .Xr msk 4 , .Xr nge 4 , .Xr re 4 , +.Xr sge 4 , .Xr stge 4 , .Xr ti 4 , .Xr txp 4 , @@ -172,7 +173,6 @@ natively: .Xr nve 4 , .Xr rl 4 , .Xr sf 4 , -.Xr sge 4 , .Xr sis 4 , .Xr sk 4 , .Xr ste 4 , From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 18:32:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A47F10656F6; Thu, 29 Apr 2010 18:32:14 +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 5068F8FC21; Thu, 29 Apr 2010 18:32: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 o3TIWEtL024568; Thu, 29 Apr 2010 18:32:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TIWE5j024566; Thu, 29 Apr 2010 18:32:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004291832.o3TIWE5j024566@svn.freebsd.org> From: Xin LI Date: Thu, 29 Apr 2010 18:32: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: r207382 - 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: Thu, 29 Apr 2010 18:32:14 -0000 Author: delphij Date: Thu Apr 29 18:32:14 2010 New Revision: 207382 URL: http://svn.freebsd.org/changeset/base/207382 Log: bwn(4) will first appear in FreeBSD 8.1-RELEASE. MFC after: 1 week Modified: head/share/man/man4/bwn.4 Modified: head/share/man/man4/bwn.4 ============================================================================== --- head/share/man/man4/bwn.4 Thu Apr 29 18:21:27 2010 (r207381) +++ head/share/man/man4/bwn.4 Thu Apr 29 18:32:14 2010 (r207382) @@ -123,7 +123,7 @@ ifconfig wlan create wlandev bwn0 ssid m The .Nm driver first appeared in -.Fx 8.0 . +.Fx 8.1 . .Sh AUTHORS .An -nosplit The From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 18:37:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B80A6106566B; Thu, 29 Apr 2010 18:37:56 +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 A6DDD8FC16; Thu, 29 Apr 2010 18:37: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 o3TIbuaF025883; Thu, 29 Apr 2010 18:37:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TIbuib025881; Thu, 29 Apr 2010 18:37:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004291837.o3TIbuib025881@svn.freebsd.org> From: Xin LI Date: Thu, 29 Apr 2010 18:37: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: r207383 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 18:37:56 -0000 Author: delphij Date: Thu Apr 29 18:37:56 2010 New Revision: 207383 URL: http://svn.freebsd.org/changeset/base/207383 Log: Add FreeBSD 8.1 to known list as it's being referenced by a couple of manpages already. MFC after: 3 days Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Thu Apr 29 18:32:14 2010 (r207382) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Thu Apr 29 18:37:56 2010 (r207383) @@ -75,6 +75,7 @@ .ds doc-operating-system-FreeBSD-7.2 7.2 .ds doc-operating-system-FreeBSD-7.3 7.3 .ds doc-operating-system-FreeBSD-8.0 8.0 +.ds doc-operating-system-FreeBSD-8.1 8.1 .ds doc-operating-system-FreeBSD-9.0 9.0 . .\" Definitions not (yet) in doc-syms From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 19:06:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77839106564A; Thu, 29 Apr 2010 19:06:43 +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 64AD08FC1A; Thu, 29 Apr 2010 19:06:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3TJ6hoH032290; Thu, 29 Apr 2010 19:06:43 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TJ6hpu032288; Thu, 29 Apr 2010 19:06:43 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201004291906.o3TJ6hpu032288@svn.freebsd.org> From: Matt Jacob Date: Thu, 29 Apr 2010 19:06:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207384 - stable/8/sbin/geom/class/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 19:06:43 -0000 Author: mjacob Date: Thu Apr 29 19:06:43 2010 New Revision: 207384 URL: http://svn.freebsd.org/changeset/base/207384 Log: This is an MFC of 205847 Change how multipath labels are created and managed. This makes it easier to support various storage boxes which really aren't active-active. We only write the label on the *first* provider. For all other providers we just "add" the disk. This also allows for an "add" verb. A usage implication is that you should specificy the currently active storage path as the first provider. Note that this does not add RDAC-like functionality, but better allows for autovolumefailover configurations (additional checkins elsewhere will support this). Modified: stable/8/sbin/geom/class/multipath/geom_multipath.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- stable/8/sbin/geom/class/multipath/geom_multipath.c Thu Apr 29 18:37:56 2010 (r207383) +++ stable/8/sbin/geom/class/multipath/geom_multipath.c Thu Apr 29 19:06:43 2010 (r207384) @@ -48,6 +48,7 @@ uint32_t version = G_MULTIPATH_VERSION; static void mp_main(struct gctl_req *, unsigned int); static void mp_label(struct gctl_req *); static void mp_clear(struct gctl_req *); +static void mp_add(struct gctl_req *); struct g_command class_commands[] = { { @@ -55,6 +56,10 @@ struct g_command class_commands[] = { NULL, "[-v] name prov ..." }, { + "add", G_FLAG_VERBOSE | G_FLAG_LOADKLD, mp_main, G_NULL_OPTS, + NULL, "[-v] name prov ..." + }, + { "destroy", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, "[-v] prov ..." }, @@ -85,6 +90,8 @@ mp_main(struct gctl_req *req, unsigned i } if (strcmp(name, "label") == 0) { mp_label(req); + } else if (strcmp(name, "add") == 0) { + mp_add(req); } else if (strcmp(name, "clear") == 0) { mp_clear(req); } else { @@ -101,7 +108,7 @@ mp_label(struct gctl_req *req) char *ptr; uuid_t uuid; uint32_t secsize = 0, ssize, status; - const char *name; + const char *name, *mpname; int error, i, nargs; nargs = gctl_get_int(req, "nargs"); @@ -156,8 +163,8 @@ mp_label(struct gctl_req *req) */ strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic)); md.md_version = G_MULTIPATH_VERSION; - name = gctl_get_ascii(req, "arg0"); - strlcpy(md.md_name, name, sizeof(md.md_name)); + mpname = gctl_get_ascii(req, "arg0"); + strlcpy(md.md_name, mpname, sizeof(md.md_name)); md.md_size = disksiz; md.md_sectorsize = secsize; uuid_create(&uuid, &status); @@ -174,46 +181,44 @@ mp_label(struct gctl_req *req) free(ptr); /* - * Clear last sector first for each provider to spoil anything extant + * Clear metadata on initial provider first. */ - for (i = 1; i < nargs; i++) { - name = gctl_get_ascii(req, "arg%d", i); - error = g_metadata_clear(name, NULL); - if (error != 0) { - gctl_error(req, "cannot clear metadata on %s: %s.", - name, strerror(error)); - return; - } + name = gctl_get_ascii(req, "arg1"); + error = g_metadata_clear(name, NULL); + if (error != 0) { + gctl_error(req, "cannot clear metadata on %s: %s.", name, strerror(error)); + return; } + /* + * encode the metadata + */ multipath_metadata_encode(&md, sector); /* - * Ok, store metadata. + * Store metadata on the initial provider. */ - for (i = 1; i < nargs; i++) { - name = gctl_get_ascii(req, "arg%d", i); - error = g_metadata_store(name, sector, secsize); - if (error != 0) { - fprintf(stderr, "Can't store metadata on %s: %s.\n", - name, strerror(error)); - goto fail; - } + error = g_metadata_store(name, sector, secsize); + if (error != 0) { + gctl_error(req, "cannot store metadata on %s: %s.", name, strerror(error)); + return; } - return; -fail: /* - * Clear last sector first for each provider to spoil anything extant + * Now add the rest of the providers. */ - for (i = 1; i < nargs; i++) { - name = gctl_get_ascii(req, "arg%d", i); - error = g_metadata_clear(name, NULL); - if (error != 0) { - gctl_error(req, "cannot clear metadata on %s: %s.", - name, strerror(error)); + error = gctl_change_param(req, "verb", -1, "add"); + if (error) { + gctl_error(req, "unable to change verb to \"add\": %s.", strerror(error)); + return; + } + for (i = 2; i < nargs; i++) { + error = gctl_change_param(req, "arg1", -1, gctl_get_ascii(req, "arg%d", i)); + if (error) { + gctl_error(req, "unable to add %s to %s: %s.", gctl_get_ascii(req, "arg%d", i), mpname, strerror(error)); continue; } + mp_add(req); } } @@ -221,22 +226,23 @@ static void mp_clear(struct gctl_req *req) { const char *name; - int error, i, nargs; + int error; - nargs = gctl_get_int(req, "nargs"); - if (nargs < 1) { - gctl_error(req, "Too few arguments."); - return; + name = gctl_get_ascii(req, "arg1"); + error = g_metadata_clear(name, G_MULTIPATH_MAGIC); + if (error != 0) { + fprintf(stderr, "Can't clear metadata on %s: %s.\n", name, strerror(error)); + gctl_error(req, "Not fully done."); } +} - for (i = 0; i < nargs; i++) { - name = gctl_get_ascii(req, "arg%d", i); - error = g_metadata_clear(name, G_MULTIPATH_MAGIC); - if (error != 0) { - fprintf(stderr, "Can't clear metadata on %s: %s.\n", - name, strerror(error)); - gctl_error(req, "Not fully done."); - continue; - } - } +static void +mp_add(struct gctl_req *req) +{ + const char *errstr; + + errstr = gctl_issue(req); + if (errstr != NULL && errstr[0] != '\0') { + gctl_error(req, "%s", errstr); + } } From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 19:07:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B09A1065672; Thu, 29 Apr 2010 19:07:59 +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 186498FC24; Thu, 29 Apr 2010 19:07: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 o3TJ7w8C032605; Thu, 29 Apr 2010 19:07:58 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TJ7wQD032603; Thu, 29 Apr 2010 19:07:58 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201004291907.o3TJ7wQD032603@svn.freebsd.org> From: Matt Jacob Date: Thu, 29 Apr 2010 19:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207385 - stable/7/sbin/geom/class/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 19:07:59 -0000 Author: mjacob Date: Thu Apr 29 19:07:58 2010 New Revision: 207385 URL: http://svn.freebsd.org/changeset/base/207385 Log: This is an MFC of 205847 Change how multipath labels are created and managed. This makes it easier to support various storage boxes which really aren't active-active. We only write the label on the *first* provider. For all other providers we just "add" the disk. This also allows for an "add" verb. A usage implication is that you should specificy the currently active storage path as the first provider. Note that this does not add RDAC-like functionality, but better allows for autovolumefailover configurations (additional checkins elsewhere will support this). Modified: stable/7/sbin/geom/class/multipath/geom_multipath.c Directory Properties: stable/7/sbin/geom/ (props changed) stable/7/sbin/geom/class/label/ (props changed) stable/7/sbin/geom/class/part/ (props changed) stable/7/sbin/geom/class/stripe/ (props changed) stable/7/sbin/geom/misc/ (props changed) Modified: stable/7/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- stable/7/sbin/geom/class/multipath/geom_multipath.c Thu Apr 29 19:06:43 2010 (r207384) +++ stable/7/sbin/geom/class/multipath/geom_multipath.c Thu Apr 29 19:07:58 2010 (r207385) @@ -48,6 +48,7 @@ uint32_t version = G_MULTIPATH_VERSION; static void mp_main(struct gctl_req *, unsigned int); static void mp_label(struct gctl_req *); static void mp_clear(struct gctl_req *); +static void mp_add(struct gctl_req *); struct g_command class_commands[] = { { @@ -55,6 +56,10 @@ struct g_command class_commands[] = { NULL, "[-v] name prov ..." }, { + "add", G_FLAG_VERBOSE | G_FLAG_LOADKLD, mp_main, G_NULL_OPTS, + NULL, "[-v] name prov ..." + }, + { "destroy", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, "[-v] prov ..." }, @@ -85,6 +90,8 @@ mp_main(struct gctl_req *req, unsigned i } if (strcmp(name, "label") == 0) { mp_label(req); + } else if (strcmp(name, "add") == 0) { + mp_add(req); } else if (strcmp(name, "clear") == 0) { mp_clear(req); } else { @@ -101,7 +108,7 @@ mp_label(struct gctl_req *req) char *ptr; uuid_t uuid; uint32_t secsize = 0, ssize, status; - const char *name; + const char *name, *mpname; int error, i, nargs; nargs = gctl_get_int(req, "nargs"); @@ -156,8 +163,8 @@ mp_label(struct gctl_req *req) */ strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic)); md.md_version = G_MULTIPATH_VERSION; - name = gctl_get_ascii(req, "arg0"); - strlcpy(md.md_name, name, sizeof(md.md_name)); + mpname = gctl_get_ascii(req, "arg0"); + strlcpy(md.md_name, mpname, sizeof(md.md_name)); md.md_size = disksiz; md.md_sectorsize = secsize; uuid_create(&uuid, &status); @@ -174,46 +181,44 @@ mp_label(struct gctl_req *req) free(ptr); /* - * Clear last sector first for each provider to spoil anything extant + * Clear metadata on initial provider first. */ - for (i = 1; i < nargs; i++) { - name = gctl_get_ascii(req, "arg%d", i); - error = g_metadata_clear(name, NULL); - if (error != 0) { - gctl_error(req, "cannot clear metadata on %s: %s.", - name, strerror(error)); - return; - } + name = gctl_get_ascii(req, "arg1"); + error = g_metadata_clear(name, NULL); + if (error != 0) { + gctl_error(req, "cannot clear metadata on %s: %s.", name, strerror(error)); + return; } + /* + * encode the metadata + */ multipath_metadata_encode(&md, sector); /* - * Ok, store metadata. + * Store metadata on the initial provider. */ - for (i = 1; i < nargs; i++) { - name = gctl_get_ascii(req, "arg%d", i); - error = g_metadata_store(name, sector, secsize); - if (error != 0) { - fprintf(stderr, "Can't store metadata on %s: %s.\n", - name, strerror(error)); - goto fail; - } + error = g_metadata_store(name, sector, secsize); + if (error != 0) { + gctl_error(req, "cannot store metadata on %s: %s.", name, strerror(error)); + return; } - return; -fail: /* - * Clear last sector first for each provider to spoil anything extant + * Now add the rest of the providers. */ - for (i = 1; i < nargs; i++) { - name = gctl_get_ascii(req, "arg%d", i); - error = g_metadata_clear(name, NULL); - if (error != 0) { - gctl_error(req, "cannot clear metadata on %s: %s.", - name, strerror(error)); + error = gctl_change_param(req, "verb", -1, "add"); + if (error) { + gctl_error(req, "unable to change verb to \"add\": %s.", strerror(error)); + return; + } + for (i = 2; i < nargs; i++) { + error = gctl_change_param(req, "arg1", -1, gctl_get_ascii(req, "arg%d", i)); + if (error) { + gctl_error(req, "unable to add %s to %s: %s.", gctl_get_ascii(req, "arg%d", i), mpname, strerror(error)); continue; } + mp_add(req); } } @@ -221,22 +226,23 @@ static void mp_clear(struct gctl_req *req) { const char *name; - int error, i, nargs; + int error; - nargs = gctl_get_int(req, "nargs"); - if (nargs < 1) { - gctl_error(req, "Too few arguments."); - return; + name = gctl_get_ascii(req, "arg1"); + error = g_metadata_clear(name, G_MULTIPATH_MAGIC); + if (error != 0) { + fprintf(stderr, "Can't clear metadata on %s: %s.\n", name, strerror(error)); + gctl_error(req, "Not fully done."); } +} - for (i = 0; i < nargs; i++) { - name = gctl_get_ascii(req, "arg%d", i); - error = g_metadata_clear(name, G_MULTIPATH_MAGIC); - if (error != 0) { - fprintf(stderr, "Can't clear metadata on %s: %s.\n", - name, strerror(error)); - gctl_error(req, "Not fully done."); - continue; - } - } +static void +mp_add(struct gctl_req *req) +{ + const char *errstr; + + errstr = gctl_issue(req); + if (errstr != NULL && errstr[0] != '\0') { + gctl_error(req, "%s", errstr); + } } From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 19:11:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23530106564A; Thu, 29 Apr 2010 19:11:26 +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 1179A8FC08; Thu, 29 Apr 2010 19:11: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 o3TJBPdf033422; Thu, 29 Apr 2010 19:11:25 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TJBP2H033420; Thu, 29 Apr 2010 19:11:25 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201004291911.o3TJBP2H033420@svn.freebsd.org> From: Matt Jacob Date: Thu, 29 Apr 2010 19:11: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: r207386 - stable/8/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 19:11:26 -0000 Author: mjacob Date: Thu Apr 29 19:11:25 2010 New Revision: 207386 URL: http://svn.freebsd.org/changeset/base/207386 Log: This is an MFC of 205932. nit: xpt_bus_deregister has to be called with the sim lock held. Modified: stable/8/sys/dev/mpt/mpt_cam.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Thu Apr 29 19:07:58 2010 (r207385) +++ stable/8/sys/dev/mpt/mpt_cam.c Thu Apr 29 19:11:25 2010 (r207386) @@ -1208,14 +1208,18 @@ mpt_cam_detach(struct mpt_softc *mpt) if (mpt->sim != NULL) { xpt_free_path(mpt->path); + MPT_LOCK(mpt); xpt_bus_deregister(cam_sim_path(mpt->sim)); + MPT_UNLOCK(mpt); cam_sim_free(mpt->sim, TRUE); mpt->sim = NULL; } if (mpt->phydisk_sim != NULL) { xpt_free_path(mpt->phydisk_path); + MPT_LOCK(mpt); xpt_bus_deregister(cam_sim_path(mpt->phydisk_sim)); + MPT_UNLOCK(mpt); cam_sim_free(mpt->phydisk_sim, TRUE); mpt->phydisk_sim = NULL; } From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 19:13:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D224106564A; Thu, 29 Apr 2010 19:13:42 +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 4BA098FC21; Thu, 29 Apr 2010 19:13:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3TJDgwN033958; Thu, 29 Apr 2010 19:13:42 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TJDgS4033956; Thu, 29 Apr 2010 19:13:42 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201004291913.o3TJDgS4033956@svn.freebsd.org> From: Matt Jacob Date: Thu, 29 Apr 2010 19:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207387 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 19:13:42 -0000 Author: mjacob Date: Thu Apr 29 19:13:42 2010 New Revision: 207387 URL: http://svn.freebsd.org/changeset/base/207387 Log: This is an MFC of 205932. nit: xpt_bus_deregister has to be called with the sim lock held. Modified: stable/7/sys/dev/mpt/mpt_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Thu Apr 29 19:11:25 2010 (r207386) +++ stable/7/sys/dev/mpt/mpt_cam.c Thu Apr 29 19:13:42 2010 (r207387) @@ -1208,14 +1208,18 @@ mpt_cam_detach(struct mpt_softc *mpt) if (mpt->sim != NULL) { xpt_free_path(mpt->path); + MPT_LOCK(mpt); xpt_bus_deregister(cam_sim_path(mpt->sim)); + MPT_UNLOCK(mpt); cam_sim_free(mpt->sim, TRUE); mpt->sim = NULL; } if (mpt->phydisk_sim != NULL) { xpt_free_path(mpt->phydisk_path); + MPT_LOCK(mpt); xpt_bus_deregister(cam_sim_path(mpt->phydisk_sim)); + MPT_UNLOCK(mpt); cam_sim_free(mpt->phydisk_sim, TRUE); mpt->phydisk_sim = NULL; } From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 20:51:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08DA4106564A; Thu, 29 Apr 2010 20:51:30 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id BC9578FC0A; Thu, 29 Apr 2010 20:51:29 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id 87E5A11BAAA; Thu, 29 Apr 2010 15:51:28 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id W6XZP8SFF2IA; Thu, 29 Apr 2010 15:51:28 -0500 Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <20100429152321.GF2391@deviant.kiev.zoral.com.ua> Date: Thu, 29 Apr 2010 21:51:25 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <7CD86617-BE58-44EC-A562-76BBAC4CB851@freebsd.org> References: <201004291519.o3TFJB8A081505@svn.freebsd.org> <20100429152321.GF2391@deviant.kiev.zoral.com.ua> To: Kostik Belousov X-Mailer: Apple Mail (2.1078) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207370 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Apr 2010 20:51:30 -0000 On 29 Apr 2010, at 16:23, Kostik Belousov wrote: > On Thu, Apr 29, 2010 at 03:19:11PM +0000, Rui Paulo wrote: >> Author: rpaulo >> Date: Thu Apr 29 15:19:11 2010 >> New Revision: 207370 >> URL: http://svn.freebsd.org/changeset/base/207370 >>=20 >> Log: >> Decrement rxa_pad due to the addition of rxa_private. > If the goal was to keep the size of the struct ieee80211_rx_ampdu > as it was before addition of rxa_private, then this commit > still did not achieved it on 32bit arches. No, not really. It's more like a reminder for when I MFC. In general = it's okay that this padding shrinks this structure, I believe. Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 21:22:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9B4D41065675; Thu, 29 Apr 2010 21:22:22 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 712DB8FC25; Thu, 29 Apr 2010 21:22: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 o3TLMMIG062389; Thu, 29 Apr 2010 21:22:22 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TLMMEA062387; Thu, 29 Apr 2010 21:22:22 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <201004292122.o3TLMMEA062387@svn.freebsd.org> From: Philip Paeps Date: Thu, 29 Apr 2010 21:22:22 +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: r207389 - 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: Thu, 29 Apr 2010 21:22:22 -0000 Author: philip Date: Thu Apr 29 21:22:21 2010 New Revision: 207389 URL: http://svn.freebsd.org/changeset/base/207389 Log: Take bushman's commit bit into safekeeping per his request (a while ago now). Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Apr 29 20:08:49 2010 (r207388) +++ svnadmin/conf/access Thu Apr 29 21:22:21 2010 (r207389) @@ -39,7 +39,6 @@ brucec brueffer bruno bschmidt -bushman bz cbzimmer ceri From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 21:55:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43433106566B; Thu, 29 Apr 2010 21:55:21 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 31F578FC0A; Thu, 29 Apr 2010 21:55:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3TLtLQs069599; Thu, 29 Apr 2010 21:55:21 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TLtLH7069598; Thu, 29 Apr 2010 21:55:21 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201004292155.o3TLtLH7069598@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 29 Apr 2010 21:55: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: r207390 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 21:55:21 -0000 Author: pjd Date: Thu Apr 29 21:55:20 2010 New Revision: 207390 URL: http://svn.freebsd.org/changeset/base/207390 Log: Default connection timeout is way too long. To make it shorter we have to make socket non-blocking, connect() and if we get EINPROGRESS, we have to wait using select(). Very complex, but I know no other way to define connection timeout for a given socket. Reported by: hiroshi@soupacific.com MFC after: 3 days Modified: head/sbin/hastd/proto_tcp4.c Modified: head/sbin/hastd/proto_tcp4.c ============================================================================== --- head/sbin/hastd/proto_tcp4.c Thu Apr 29 21:22:21 2010 (r207389) +++ head/sbin/hastd/proto_tcp4.c Thu Apr 29 21:55:20 2010 (r207390) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -47,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include "hast.h" #include "pjdlog.h" #include "proto_impl.h" +#include "subr.h" #define TCP4_CTX_MAGIC 0x7c441c struct tcp4_ctx { @@ -222,18 +224,88 @@ static int tcp4_connect(void *ctx) { struct tcp4_ctx *tctx = ctx; + struct timeval tv; + fd_set fdset; + socklen_t esize; + int error, flags, ret; assert(tctx != NULL); assert(tctx->tc_magic == TCP4_CTX_MAGIC); assert(tctx->tc_side == TCP4_SIDE_CLIENT); assert(tctx->tc_fd >= 0); - if (connect(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sin, - sizeof(tctx->tc_sin)) < 0) { + flags = fcntl(tctx->tc_fd, F_GETFL); + if (flags == -1) { + KEEP_ERRNO(pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_GETFL) failed")); + return (errno); + } + /* + * We make socket non-blocking so we have decided about connection + * timeout. + */ + flags |= O_NONBLOCK; + if (fcntl(tctx->tc_fd, F_SETFL, flags) == -1) { + KEEP_ERRNO(pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_SETFL, O_NONBLOCK) failed")); return (errno); } - return (0); + if (connect(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sin, + sizeof(tctx->tc_sin)) == 0) { + error = 0; + goto done; + } + if (errno != EINPROGRESS) { + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, "connect() failed"); + goto done; + } + /* + * Connection can't be established immediately, let's wait + * for HAST_TIMEOUT seconds. + */ + tv.tv_sec = HAST_TIMEOUT; + tv.tv_usec = 0; +again: + FD_ZERO(&fdset); + FD_SET(tctx->tc_fd, &fdset); + ret = select(tctx->tc_fd + 1, NULL, &fdset, NULL, &tv); + if (ret == 0) { + error = ETIMEDOUT; + goto done; + } else if (ret == -1) { + if (errno == EINTR) + goto again; + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, "select() failed"); + goto done; + } + assert(ret > 0); + assert(FD_ISSET(tctx->tc_fd, &fdset)); + esize = sizeof(error); + if (getsockopt(tctx->tc_fd, SOL_SOCKET, SO_ERROR, &error, + &esize) == -1) { + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, + "getsockopt(SO_ERROR) failed"); + goto done; + } + if (error != 0) { + pjdlog_common(LOG_DEBUG, 1, error, + "getsockopt(SO_ERROR) returned error"); + goto done; + } + error = 0; +done: + flags &= ~O_NONBLOCK; + if (fcntl(tctx->tc_fd, F_SETFL, flags) == -1) { + if (error == 0) + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_SETFL, ~O_NONBLOCK) failed"); + } + return (error); } static int From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 22:00:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B33771065672; Thu, 29 Apr 2010 22:00:57 +0000 (UTC) (envelope-from davidch@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id A20BE8FC08; Thu, 29 Apr 2010 22:00: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 o3TM0vRY070889; Thu, 29 Apr 2010 22:00:57 GMT (envelope-from davidch@svn.freebsd.org) Received: (from davidch@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TM0vdb070887; Thu, 29 Apr 2010 22:00:57 GMT (envelope-from davidch@svn.freebsd.org) Message-Id: <201004292200.o3TM0vdb070887@svn.freebsd.org> From: David Christensen Date: Thu, 29 Apr 2010 22:00: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: r207391 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 22:00:57 -0000 Author: davidch Date: Thu Apr 29 22:00:57 2010 New Revision: 207391 URL: http://svn.freebsd.org/changeset/base/207391 Log: - Pass flow control settings back to bce(4). MFC after: Two weeks Modified: head/sys/dev/mii/brgphy.c Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Thu Apr 29 21:55:20 2010 (r207390) +++ head/sys/dev/mii/brgphy.c Thu Apr 29 22:00:57 2010 (r207391) @@ -685,16 +685,15 @@ brgphy_status(struct mii_softc *sc) } -#if 0 - /* Todo: Change bge/bce to use these settings. */ + /* Todo: Change bge to use these settings. */ - /* Fetch flow control settings from the PHY */ + /* Fetch flow control settings from the copper PHY. */ if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { - /* Set FLAG0 is RX is enabled and FLAG1 if TX is enabled */ + /* Set FLAG0 if RX is enabled and FLAG1 if TX is enabled */ if ((anar & BRGPHY_ANAR_PC) && (anlpar & BRGPHY_ANLPAR_PC)) { mii->mii_media_active |= IFM_FLAG0 | IFM_FLAG1; } else if (!(anar & BRGPHY_ANAR_PC) && (anlpar & BRGPHY_ANAR_ASP) && - (anlpar & BRPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) { + (anlpar & BRGPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) { mii->mii_media_active |= IFM_FLAG1; } else if ((anar & BRGPHY_ANAR_PC) && (anar & BRGPHY_ANAR_ASP) && !(anlpar & BRGPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) { @@ -703,7 +702,6 @@ brgphy_status(struct mii_softc *sc) } /* Todo: Add support for fiber settings too. */ -#endif brgphy_status_exit: From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 22:40:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AABC5106566B; Thu, 29 Apr 2010 22:40:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 970DE8FC08; Thu, 29 Apr 2010 22:40: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 o3TMeCQM080031; Thu, 29 Apr 2010 22:40:12 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TMeCSe080026; Thu, 29 Apr 2010 22:40:12 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201004292240.o3TMeCSe080026@svn.freebsd.org> From: Andrew Thompson Date: Thu, 29 Apr 2010 22:40: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: r207397 - in stable/8: etc etc/devd sbin/devd sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 22:40:12 -0000 Author: thompsa Date: Thu Apr 29 22:40:12 2010 New Revision: 207397 URL: http://svn.freebsd.org/changeset/base/207397 Log: MFC r207020, r207027, r207072. Change usb devd events from fake attach to a notify. The ugen device is not a proper device_t so it faked the devctl event to appear like one, this is now a notify which allows more information to be passed. We notify for both the device attach/detach and for each usb interface. A devd rule can now match on the interface properties, including composite devices which may have a uvideo interface and also usound and possibly uhid too. An example to match a umass device with a scsi subclass and BBB protocol would be notify 100 { match "system" "USB"; match "subsystem" "INTERFACE"; match "type" "ATTACH"; match "intclass" "0x08"; match "intsubclass" "0x06"; match "intprotocol" "0x50"; action ... }; The old attach devctl event has been retained for the moment to make merging to 8.1 easier. This was never compatible with 7.x or earlier due to the ugen regex change needed. Document the new USB notification types. Modified: stable/8/etc/devd.conf stable/8/etc/devd/uath.conf stable/8/sbin/devd/devd.conf.5 stable/8/sys/dev/usb/usb_device.c Directory Properties: stable/8/etc/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/etc/devd.conf ============================================================================== --- stable/8/etc/devd.conf Thu Apr 29 22:30:59 2010 (r207396) +++ stable/8/etc/devd.conf Thu Apr 29 22:40:12 2010 (r207397) @@ -138,12 +138,14 @@ attach 100 { # This entry starts the ColdSync tool in daemon mode. Make sure you have an up # to date /usr/local/etc/palms. We override the 'listen' settings for port and # type in /usr/local/etc/coldsync.conf. -attach 100 { - device-name "ugen[0-9]+"; - match "vendor" "0x082d"; - match "product" "0x0100"; - match "release" "0x0100"; - action "/usr/local/bin/coldsync -md -p /dev/$device-name -t usb"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x082d"; + match "product" "0x0100"; + match "release" "0x0100"; + action "/usr/local/bin/coldsync -md -p /dev/$cdev -t usb"; }; # Modified: stable/8/etc/devd/uath.conf ============================================================================== --- stable/8/etc/devd/uath.conf Thu Apr 29 22:30:59 2010 (r207396) +++ stable/8/etc/devd/uath.conf Thu Apr 29 22:40:12 2010 (r207397) @@ -4,117 +4,143 @@ # Accton # SMCWUSB-G and SMCWUSBT-G2 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x083a"; - match "product" "(0x4505|0x4507)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x083a"; + match "product" "(0x4505|0x4507)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Atheros Communications # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x168c"; - match "product" "0x0002"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x168c"; + match "product" "0x0002"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Atheros Communications # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x0cf3"; - match "product" "(0x0002|0x0004|0x0006)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0cf3"; + match "product" "(0x0002|0x0004|0x0006)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Conceptronic # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x0d8e"; - match "product" "(0x7802|0x7812)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0d8e"; + match "product" "(0x7802|0x7812)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # D-Link # DWL-AG132, DWL-G132 and DWL-AG122 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x2001"; - match "product" "(0x3a01|0x3a03|0x3a05)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x2001"; + match "product" "(0x3a01|0x3a03|0x3a05)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # D-Link # DWA-120 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x07d1"; - match "product" "0x3a0c"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x07d1"; + match "product" "0x3a0c"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Gigaset # SMCWUSBT-G -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x1690"; - match "product" "(0x0711|0x0713)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x1690"; + match "product" "(0x0711|0x0713)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Global Sun Technology # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x16ab"; - match "product" "(0x7802|0x7812)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x16ab"; + match "product" "(0x7802|0x7812)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # BayNETGEAR # WG111U -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x0846"; - match "product" "0x4301"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0846"; + match "product" "0x4301"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Netgear # WG111T and WPN111 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x1385"; - match "product" "(0x4251|0x5f01)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x1385"; + match "product" "(0x4251|0x5f01)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # U-MEDIA Communications # TEW-444UB and AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x157e"; - match "product" "(0x3007|0x3206)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x157e"; + match "product" "(0x3007|0x3206)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Wistron NeWeb # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x1435"; - match "product" "(0x0827|0x0829)"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x1435"; + match "product" "(0x0827|0x0829)"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; # Z-Com # AR5523 -attach 100 { - device-name "ugen[0-9.]+"; - match "vendor" "0x0cde"; - match "product" "0x0013"; - action "/usr/sbin/uathload -d /dev/$device-name"; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0cde"; + match "product" "0x0013"; + action "/usr/sbin/uathload -d /dev/$cdev"; }; Modified: stable/8/sbin/devd/devd.conf.5 ============================================================================== --- stable/8/sbin/devd/devd.conf.5 Thu Apr 29 22:30:59 2010 (r207396) +++ stable/8/sbin/devd/devd.conf.5 Thu Apr 29 22:40:12 2010 (r207397) @@ -250,18 +250,40 @@ CIS-vendor. Device class. .It Li device Device ID. +.It Li devclass +Device Class (USB) +.It Li devsubclass +Device Sub-class (USB) .It Li device-name Name of attached/detached device. +.It Li endpoints +Endpoint count (USB) .It Li function Card functions. +.It Li interface +Interface ID (USB) +.It Li intclass +Interface Class (USB) +.It Li intprotocol +Interface Protocol (USB) +.It Li intsubclass +Interface Sub-class (USB) .It Li manufacturer Manufacturer ID (pccard). +.It Li mode +Peripheral mode (USB) .It Li notify Match the value of the .Dq Li notify variable. +.It Li parent +Parent device +.It Li port +Hub port number (USB) .It Li product -Product ID (pccard). +Product ID (pccard/USB). +.It Li release +Hardware revision (USB) .It Li serial Serial Number (USB). .It Li slot @@ -342,6 +364,27 @@ The node is destroyed. .El .El +.It Li USB +Events related to the USB subsystem. +.Bl -tag -width ".Sy Subsystem" -compact +.It Sy Subsystem +.It Li DEVICE +.Bl -tag -width ".Li DETACH" -compact +.It Sy Type +.It Li ATTACH +USB device is attached to the system. +.It Li DETACH +USB device is detached from the system. +.El +.It Li INTERFACE +.Bl -tag -width ".Li DETACH" -compact +.It Sy Type +.It Li ATTACH +USB interface is attached from a device. +.It Li DETACH +USB interface is detached from a device. +.El +.El .It Li coretemp Events related to the .Xr coretemp 4 @@ -461,6 +504,17 @@ notify 0 { }; # +# Match a USB device type +# +notify 0 { + match "system" "USB"; + match "subsystem" "INTERFACE"; + match "type" "ATTACH"; + match "intclass" "0x0e"; + action "logger USB video device attached"; +}; + +# # Try to configure ath and wi devices with pccard_ether # as they are attached. # Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Thu Apr 29 22:30:59 2010 (r207396) +++ stable/8/sys/dev/usb/usb_device.c Thu Apr 29 22:40:12 2010 (r207397) @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -1834,7 +1835,7 @@ config_done: printf("%s: <%s> at %s\n", udev->ugen_name, udev->manufacturer, device_get_nameunit(udev->bus->bdev)); - usb_notify_addq("+", udev); + usb_notify_addq("ATTACH", udev); #endif done: if (err) { @@ -1980,7 +1981,7 @@ usb_free_device(struct usb_device *udev, usb_set_device_state(udev, USB_STATE_DETACHED); #if USB_HAVE_UGEN - usb_notify_addq("-", udev); + usb_notify_addq("DETACH", udev); printf("%s: <%s> at %s (disconnected)\n", udev->ugen_name, udev->manufacturer, device_get_nameunit(bus->bdev)); @@ -2347,13 +2348,23 @@ usbd_get_device_index(struct usb_device * * This function will generate events for dev. *------------------------------------------------------------------------*/ +#ifndef BURN_BRIDGES static void -usb_notify_addq(const char *type, struct usb_device *udev) +usb_notify_addq_compat(const char *type, struct usb_device *udev) { char *data = NULL; + const char *ntype; struct malloc_type *mt; const size_t buf_size = 512; + /* Convert notify type */ + if (strcmp(type, "ATTACH") == 0) + ntype = "+"; + else if (strcmp(type, "DETACH") == 0) + ntype = "-"; + else + return; + mtx_lock(&malloc_mtx); mt = malloc_desc2type("bus"); /* XXX M_BUS */ mtx_unlock(&malloc_mtx); @@ -2378,7 +2389,7 @@ usb_notify_addq(const char *type, struct "port=%u " "on " "%s\n", - type, + ntype, udev->ugen_name, UGETW(udev->ddesc.idVendor), UGETW(udev->ddesc.idProduct), @@ -2393,6 +2404,89 @@ usb_notify_addq(const char *type, struct devctl_queue_data(data); } +#endif + +static void +usb_notify_addq(const char *type, struct usb_device *udev) +{ + struct usb_interface *iface; + struct sbuf *sb; + int i; + +#ifndef BURN_BRIDGES + usb_notify_addq_compat(type, udev); +#endif + + /* announce the device */ + sb = sbuf_new_auto(); + sbuf_printf(sb, + "cdev=%s " + "vendor=0x%04x " + "product=0x%04x " + "devclass=0x%02x " + "devsubclass=0x%02x " + "sernum=\"%s\" " + "release=0x%04x " + "mode=%s " + "port=%u " + "parent=%s\n", + udev->ugen_name, + UGETW(udev->ddesc.idVendor), + UGETW(udev->ddesc.idProduct), + udev->ddesc.bDeviceClass, + udev->ddesc.bDeviceSubClass, + udev->serial, + UGETW(udev->ddesc.bcdDevice), + (udev->flags.usb_mode == USB_MODE_HOST) ? "host" : "device", + udev->port_no, + udev->parent_hub != NULL ? + udev->parent_hub->ugen_name : + device_get_nameunit(device_get_parent(udev->bus->bdev))); + sbuf_finish(sb); + devctl_notify("USB", "DEVICE", type, sbuf_data(sb)); + sbuf_delete(sb); + + /* announce each interface */ + for (i = 0; i < USB_IFACE_MAX; i++) { + iface = usbd_get_iface(udev, i); + if (iface == NULL) + break; /* end of interfaces */ + if (iface->idesc == NULL) + continue; /* no interface descriptor */ + + sb = sbuf_new_auto(); + sbuf_printf(sb, + "cdev=%s " + "vendor=0x%04x " + "product=0x%04x " + "devclass=0x%02x " + "devsubclass=0x%02x " + "sernum=\"%s\" " + "release=0x%04x " + "mode=%s " + "interface=%d " + "endpoints=%d " + "intclass=0x%02x " + "intsubclass=0x%02x " + "intprotocol=0x%02x\n", + udev->ugen_name, + UGETW(udev->ddesc.idVendor), + UGETW(udev->ddesc.idProduct), + udev->ddesc.bDeviceClass, + udev->ddesc.bDeviceSubClass, + udev->serial, + UGETW(udev->ddesc.bcdDevice), + (udev->flags.usb_mode == USB_MODE_HOST) ? "host" : "device", + iface->idesc->bInterfaceNumber, + iface->idesc->bNumEndpoints, + iface->idesc->bInterfaceClass, + iface->idesc->bInterfaceSubClass, + iface->idesc->bInterfaceProtocol); + sbuf_finish(sb); + devctl_notify("USB", "INTERFACE", type, sbuf_data(sb)); + sbuf_delete(sb); + } +} /*------------------------------------------------------------------------* * usb_fifo_free_wrap From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 22:44:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC235106564A; Thu, 29 Apr 2010 22:44:05 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id B5EAF8FC14; Thu, 29 Apr 2010 22:44: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 o3TMi58N081024; Thu, 29 Apr 2010 22:44:05 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TMi5So080980; Thu, 29 Apr 2010 22:44:05 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201004292244.o3TMi5So080980@svn.freebsd.org> From: Andrew Thompson Date: Thu, 29 Apr 2010 22:44: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: r207399 - in stable/8/sys: amd64/conf arm/conf dev/sound/usb dev/usb dev/usb/controller dev/usb/input dev/usb/misc dev/usb/net dev/usb/serial dev/usb/storage dev/usb/wlan i386/conf ia64... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 22:44:05 -0000 Author: thompsa Date: Thu Apr 29 22:44:04 2010 New Revision: 207399 URL: http://svn.freebsd.org/changeset/base/207399 Log: MFC r207077 Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had the illusion of a tunable setting but was always turned on regardless. Modified: stable/8/sys/amd64/conf/GENERIC stable/8/sys/arm/conf/DB-78XXX stable/8/sys/arm/conf/DB-88F5XXX stable/8/sys/arm/conf/DB-88F6XXX stable/8/sys/arm/conf/HL200 stable/8/sys/arm/conf/KB920X stable/8/sys/arm/conf/SHEEVAPLUG stable/8/sys/dev/sound/usb/uaudio.c stable/8/sys/dev/usb/controller/ehci.c stable/8/sys/dev/usb/controller/uhci.c stable/8/sys/dev/usb/controller/uss820dci.c stable/8/sys/dev/usb/input/atp.c stable/8/sys/dev/usb/input/uhid.c stable/8/sys/dev/usb/input/ukbd.c stable/8/sys/dev/usb/input/ums.c stable/8/sys/dev/usb/misc/udbp.c stable/8/sys/dev/usb/net/if_aue.c stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/net/if_cdce.c stable/8/sys/dev/usb/net/if_cue.c stable/8/sys/dev/usb/net/if_kue.c stable/8/sys/dev/usb/net/if_rue.c stable/8/sys/dev/usb/net/if_udav.c stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/serial/ubsa.c stable/8/sys/dev/usb/serial/ubser.c stable/8/sys/dev/usb/serial/uchcom.c stable/8/sys/dev/usb/serial/uftdi.c stable/8/sys/dev/usb/serial/ulpt.c stable/8/sys/dev/usb/serial/umodem.c stable/8/sys/dev/usb/serial/umoscom.c stable/8/sys/dev/usb/serial/uplcom.c stable/8/sys/dev/usb/serial/usb_serial.c stable/8/sys/dev/usb/serial/uslcom.c stable/8/sys/dev/usb/serial/uvisor.c stable/8/sys/dev/usb/serial/uvscom.c stable/8/sys/dev/usb/storage/umass.c stable/8/sys/dev/usb/storage/urio.c stable/8/sys/dev/usb/storage/ustorage_fs.c stable/8/sys/dev/usb/usb_debug.h stable/8/sys/dev/usb/usb_freebsd.h stable/8/sys/dev/usb/usb_request.c stable/8/sys/dev/usb/usb_transfer.c stable/8/sys/dev/usb/wlan/if_rum.c stable/8/sys/dev/usb/wlan/if_run.c stable/8/sys/dev/usb/wlan/if_ural.c stable/8/sys/dev/usb/wlan/if_zyd.c stable/8/sys/i386/conf/GENERIC stable/8/sys/i386/conf/XBOX stable/8/sys/ia64/conf/GENERIC stable/8/sys/mips/conf/SENTRY5 stable/8/sys/pc98/conf/GENERIC stable/8/sys/powerpc/conf/GENERIC stable/8/sys/powerpc/conf/MPC85XX stable/8/sys/sparc64/conf/GENERIC stable/8/sys/sun4v/conf/GENERIC Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/amd64/conf/GENERIC ============================================================================== --- stable/8/sys/amd64/conf/GENERIC Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/amd64/conf/GENERIC Thu Apr 29 22:44:04 2010 (r207399) @@ -281,6 +281,7 @@ device firmware # firmware assist modul device bpf # Berkeley packet filter # USB support +options USB_DEBUG # enable debug msgs device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) Modified: stable/8/sys/arm/conf/DB-78XXX ============================================================================== --- stable/8/sys/arm/conf/DB-78XXX Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/arm/conf/DB-78XXX Thu Apr 29 22:44:04 2010 (r207399) @@ -66,6 +66,7 @@ device e1000phy device bpf # USB +options USB_DEBUG # enable debug msgs device usb device ehci device umass Modified: stable/8/sys/arm/conf/DB-88F5XXX ============================================================================== --- stable/8/sys/arm/conf/DB-88F5XXX Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/arm/conf/DB-88F5XXX Thu Apr 29 22:44:04 2010 (r207399) @@ -73,6 +73,7 @@ device iicbus device ds133x # USB +options USB_DEBUG # enable debug msgs device usb device ehci device umass Modified: stable/8/sys/arm/conf/DB-88F6XXX ============================================================================== --- stable/8/sys/arm/conf/DB-88F6XXX Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/arm/conf/DB-88F6XXX Thu Apr 29 22:44:04 2010 (r207399) @@ -66,6 +66,7 @@ device e1000phy device bpf # USB +options USB_DEBUG # enable debug msgs device usb device ehci device umass Modified: stable/8/sys/arm/conf/HL200 ============================================================================== --- stable/8/sys/arm/conf/HL200 Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/arm/conf/HL200 Thu Apr 29 22:44:04 2010 (r207399) @@ -94,6 +94,7 @@ device icee device bpf # USB support +options USB_DEBUG # enable debug msgs device ohci # OHCI localbus->USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices Modified: stable/8/sys/arm/conf/KB920X ============================================================================== --- stable/8/sys/arm/conf/KB920X Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/arm/conf/KB920X Thu Apr 29 22:44:04 2010 (r207399) @@ -95,6 +95,7 @@ device icee device bpf # USB support +options USB_DEBUG # enable debug msgs device ohci # OHCI localbus->USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices Modified: stable/8/sys/arm/conf/SHEEVAPLUG ============================================================================== --- stable/8/sys/arm/conf/SHEEVAPLUG Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/arm/conf/SHEEVAPLUG Thu Apr 29 22:44:04 2010 (r207399) @@ -61,6 +61,7 @@ options DEVICE_POLLING device vlan # USB +options USB_DEBUG # enable debug msgs device usb device ehci device umass Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/sound/usb/uaudio.c Thu Apr 29 22:44:04 2010 (r207399) @@ -91,7 +91,7 @@ static int uaudio_default_rate = 0; /* static int uaudio_default_bits = 32; static int uaudio_default_channels = 0; /* use default */ -#if USB_DEBUG +#ifdef USB_DEBUG static int uaudio_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); @@ -321,7 +321,7 @@ static const struct uaudio_format uaudio #define UAC_RECORD 3 #define UAC_NCLASSES 4 -#if USB_DEBUG +#ifdef USB_DEBUG static const char *uac_names[] = { "outputs", "inputs", "equalization", "record" }; @@ -406,7 +406,7 @@ static void umidi_init(device_t dev); static int32_t umidi_probe(device_t dev); static int32_t umidi_detach(device_t dev); -#if USB_DEBUG +#ifdef USB_DEBUG static void uaudio_chan_dump_ep_desc( const usb_endpoint_descriptor_audio_t *); static void uaudio_mixer_dump_cluster(uint8_t, @@ -780,7 +780,7 @@ uaudio_detach(device_t dev) * AS - Audio Stream - routines *========================================================================*/ -#if USB_DEBUG +#ifdef USB_DEBUG static void uaudio_chan_dump_ep_desc(const usb_endpoint_descriptor_audio_t *ed) { @@ -1019,7 +1019,7 @@ uaudio_chan_fill_info_sub(struct uaudio_ if ((chan->valid == 0) && usbd_get_iface(udev, curidx)) { chan->valid = 1; -#if USB_DEBUG +#ifdef USB_DEBUG uaudio_chan_dump_ep_desc(ed1); uaudio_chan_dump_ep_desc(ed2); @@ -1689,7 +1689,7 @@ uaudio_mixer_add_ctl(struct uaudio_softc uaudio_mixer_add_ctl_sub(sc, mc); -#if USB_DEBUG +#ifdef USB_DEBUG if (uaudio_debug > 2) { uint8_t i; @@ -1708,7 +1708,7 @@ static void uaudio_mixer_add_input(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { -#if USB_DEBUG +#ifdef USB_DEBUG const struct usb_audio_input_terminal *d = iot[id].u.it; DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " @@ -1724,7 +1724,7 @@ static void uaudio_mixer_add_output(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { -#if USB_DEBUG +#ifdef USB_DEBUG const struct usb_audio_output_terminal *d = iot[id].u.ot; DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " @@ -2257,7 +2257,7 @@ error: return (NULL); } -#if USB_DEBUG +#ifdef USB_DEBUG static void uaudio_mixer_dump_cluster(uint8_t id, const struct uaudio_terminal_node *iot) { @@ -2350,7 +2350,7 @@ done: return (r); } -#if USB_DEBUG +#ifdef USB_DEBUG struct uaudio_tt_to_string { uint16_t terminal_type; @@ -2856,7 +2856,7 @@ uaudio_mixer_fill_info(struct uaudio_sof (iot + i)->root = iot; } while (i--); -#if USB_DEBUG +#ifdef USB_DEBUG i = ID_max; do { uint8_t j; Modified: stable/8/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/controller/ehci.c Thu Apr 29 22:44:04 2010 (r207399) @@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$"); ((ehci_softc_t *)(((uint8_t *)(bus)) - \ ((uint8_t *)&(((ehci_softc_t *)0)->sc_bus)))) -#if USB_DEBUG +#ifdef USB_DEBUG static int ehcidebug = 0; static int ehcinohighspeed = 0; static int ehciiaadbug = 0; @@ -258,7 +258,7 @@ ehci_init(ehci_softc_t *sc) usb_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, 0); usb_callout_init_mtx(&sc->sc_tmo_poll, &sc->sc_bus.bus_mtx, 0); -#if USB_DEBUG +#ifdef USB_DEBUG if (ehciiaadbug) sc->sc_flags |= EHCI_SCFLG_IAADBUG; if (ehcilostintrbug) @@ -486,7 +486,7 @@ ehci_init(ehci_softc_t *sc) usb_bus_mem_flush_all(&sc->sc_bus, &ehci_iterate_hw_softc); -#if USB_DEBUG +#ifdef USB_DEBUG if (ehcidebug) { ehci_dump_sqh(sc, sc->sc_async_p_last); } @@ -685,7 +685,7 @@ ehci_shutdown(ehci_softc_t *sc) } } -#if USB_DEBUG +#ifdef USB_DEBUG static void ehci_dump_regs(ehci_softc_t *sc) { @@ -1229,7 +1229,7 @@ ehci_non_isoc_done_sub(struct usb_xfer * xfer->td_transfer_cache = td; -#if USB_DEBUG +#ifdef USB_DEBUG if (status & EHCI_QTD_STATERRS) { DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x" "status=%s%s%s%s%s%s%s%s\n", @@ -1260,7 +1260,7 @@ ehci_non_isoc_done(struct usb_xfer *xfer DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", xfer, xfer->endpoint); -#if USB_DEBUG +#ifdef USB_DEBUG if (ehcidebug > 10) { ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); @@ -1527,7 +1527,7 @@ ehci_interrupt(ehci_softc_t *sc) DPRINTFN(16, "real interrupt\n"); -#if USB_DEBUG +#ifdef USB_DEBUG if (ehcidebug > 15) { ehci_dump_regs(sc); } @@ -1548,7 +1548,7 @@ ehci_interrupt(ehci_softc_t *sc) if (status & EHCI_STS_HSE) { printf("%s: unrecoverable error, " "controller halted\n", __FUNCTION__); -#if USB_DEBUG +#ifdef USB_DEBUG ehci_dump_regs(sc); ehci_dump_isoc(sc); #endif @@ -1978,7 +1978,7 @@ ehci_setup_standard_chain(struct usb_xfe xfer->td_transfer_last = td; -#if USB_DEBUG +#ifdef USB_DEBUG if (ehcidebug > 8) { DPRINTF("nexttog=%d; data before transfer:\n", xfer->endpoint->toggle_next); @@ -2106,7 +2106,7 @@ ehci_isoc_fs_done(ehci_softc_t *sc, stru if (pp_last >= &sc->sc_isoc_fs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]) { pp_last = &sc->sc_isoc_fs_p_last[0]; } -#if USB_DEBUG +#ifdef USB_DEBUG if (ehcidebug > 15) { DPRINTF("isoc FS-TD\n"); ehci_dump_sitd(sc, td); @@ -2160,7 +2160,7 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru if (pp_last >= &sc->sc_isoc_hs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]) { pp_last = &sc->sc_isoc_hs_p_last[0]; } -#if USB_DEBUG +#ifdef USB_DEBUG if (ehcidebug > 15) { DPRINTF("isoc HS-TD\n"); ehci_dump_itd(sc, td); @@ -2224,7 +2224,7 @@ ehci_device_done(struct usb_xfer *xfer, if ((methods == &ehci_device_bulk_methods) || (methods == &ehci_device_ctrl_methods)) { -#if USB_DEBUG +#ifdef USB_DEBUG if (ehcidebug > 8) { DPRINTF("nexttog=%d; data after transfer:\n", xfer->endpoint->toggle_next); @@ -2509,7 +2509,7 @@ ehci_device_isoc_fs_enter(struct usb_xfe uint8_t sb; uint8_t error; -#if USB_DEBUG +#ifdef USB_DEBUG uint8_t once = 1; #endif @@ -2593,7 +2593,7 @@ ehci_device_isoc_fs_enter(struct usb_xfe /* reuse sitd_portaddr and sitd_back from last transfer */ if (*plen > xfer->max_frame_size) { -#if USB_DEBUG +#ifdef USB_DEBUG if (once) { once = 0; printf("%s: frame length(%d) exceeds %d " @@ -2683,7 +2683,7 @@ ehci_device_isoc_fs_enter(struct usb_xfe } usb_pc_cpu_flush(td->page_cache); -#if USB_DEBUG +#ifdef USB_DEBUG if (ehcidebug > 15) { DPRINTF("FS-TD %d\n", nframes); ehci_dump_sitd(sc, td); @@ -2800,7 +2800,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe uint8_t td_no; uint8_t page_no; -#if USB_DEBUG +#ifdef USB_DEBUG uint8_t once = 1; #endif @@ -2878,7 +2878,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe } /* range check */ if (*plen > xfer->max_frame_size) { -#if USB_DEBUG +#ifdef USB_DEBUG if (once) { once = 0; printf("%s: frame length(%d) exceeds %d bytes " @@ -2962,7 +2962,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe td->itd_status[td_no - 1] |= htohc32(sc, EHCI_ITD_IOC); } usb_pc_cpu_flush(td->page_cache); -#if USB_DEBUG +#ifdef USB_DEBUG if (ehcidebug > 15) { DPRINTF("HS-TD %d\n", nframes); ehci_dump_itd(sc, td); @@ -3398,7 +3398,7 @@ ehci_roothub_exec(struct usb_device *ude break; case UHF_PORT_RESET: DPRINTFN(6, "reset port %d\n", index); -#if USB_DEBUG +#ifdef USB_DEBUG if (ehcinohighspeed) { /* * Connect USB device to companion Modified: stable/8/sys/dev/usb/controller/uhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/uhci.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/controller/uhci.c Thu Apr 29 22:44:04 2010 (r207399) @@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$"); ((uhci_softc_t *)(((uint8_t *)(bus)) - \ ((uint8_t *)&(((uhci_softc_t *)0)->sc_bus)))) -#if USB_DEBUG +#ifdef USB_DEBUG static int uhcidebug = 0; static int uhcinoloop = 0; @@ -459,7 +459,7 @@ uhci_init(uhci_softc_t *sc) usb_callout_init_mtx(&sc->sc_root_intr, &sc->sc_bus.bus_mtx, 0); -#if USB_DEBUG +#ifdef USB_DEBUG if (uhcidebug > 2) { uhci_dumpregs(sc); } @@ -668,7 +668,7 @@ uhci_suspend(uhci_softc_t *sc) { USB_BUS_LOCK(&sc->sc_bus); -#if USB_DEBUG +#ifdef USB_DEBUG if (uhcidebug > 2) { uhci_dumpregs(sc); } @@ -712,7 +712,7 @@ uhci_resume(uhci_softc_t *sc) uhci_start(sc); -#if USB_DEBUG +#ifdef USB_DEBUG if (uhcidebug > 2) { uhci_dumpregs(sc); } @@ -724,7 +724,7 @@ uhci_resume(uhci_softc_t *sc) uhci_do_poll(&sc->sc_bus); } -#if USB_DEBUG +#ifdef USB_DEBUG static void uhci_dumpregs(uhci_softc_t *sc) { @@ -882,7 +882,7 @@ uhci_add_loop(uhci_softc_t *sc) struct uhci_qh *qh_lst; struct uhci_qh *qh_rec; -#if USB_DEBUG +#ifdef USB_DEBUG if (uhcinoloop) { return; } @@ -905,7 +905,7 @@ uhci_rem_loop(uhci_softc_t *sc) { struct uhci_qh *qh_lst; -#if USB_DEBUG +#ifdef USB_DEBUG if (uhcinoloop) { return; } @@ -1073,7 +1073,7 @@ uhci_isoc_done(uhci_softc_t *sc, struct if (pp_last >= &sc->sc_isoc_p_last[UHCI_VFRAMELIST_COUNT]) { pp_last = &sc->sc_isoc_p_last[0]; } -#if USB_DEBUG +#ifdef USB_DEBUG if (uhcidebug > 5) { DPRINTF("isoc TD\n"); uhci_dump_td(td); @@ -1204,7 +1204,7 @@ uhci_non_isoc_done_sub(struct usb_xfer * xfer->endpoint->toggle_next = (token & UHCI_TD_SET_DT(1)) ? 0 : 1; -#if USB_DEBUG +#ifdef USB_DEBUG if (status & UHCI_TD_ERROR) { DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x " "status=%s%s%s%s%s%s%s%s%s%s%s\n", @@ -1234,7 +1234,7 @@ uhci_non_isoc_done(struct usb_xfer *xfer DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", xfer, xfer->endpoint); -#if USB_DEBUG +#ifdef USB_DEBUG if (uhcidebug > 10) { uhci_dump_tds(xfer->td_transfer_first); } @@ -1473,7 +1473,7 @@ uhci_interrupt(uhci_softc_t *sc) DPRINTFN(16, "real interrupt\n"); -#if USB_DEBUG +#ifdef USB_DEBUG if (uhcidebug > 15) { uhci_dumpregs(sc); } @@ -1487,7 +1487,7 @@ uhci_interrupt(uhci_softc_t *sc) UHCI_STS_HCPE | UHCI_STS_HCH)) { if (status & UHCI_STS_RD) { -#if USB_DEBUG +#ifdef USB_DEBUG printf("%s: resume detect\n", __FUNCTION__); #endif @@ -1504,7 +1504,7 @@ uhci_interrupt(uhci_softc_t *sc) /* no acknowledge needed */ DPRINTF("%s: host controller halted\n", __FUNCTION__); -#if USB_DEBUG +#ifdef USB_DEBUG if (uhcidebug > 0) { uhci_dump_all(sc); } @@ -1866,7 +1866,7 @@ uhci_setup_standard_chain(struct usb_xfe xfer->td_transfer_last = td; -#if USB_DEBUG +#ifdef USB_DEBUG if (uhcidebug > 8) { DPRINTF("nexttog=%d; data before transfer:\n", xfer->endpoint->toggle_next); @@ -2182,7 +2182,7 @@ uhci_device_isoc_enter(struct usb_xfer * uint32_t temp; uint32_t *plen; -#if USB_DEBUG +#ifdef USB_DEBUG uint8_t once = 1; #endif @@ -2254,7 +2254,7 @@ uhci_device_isoc_enter(struct usb_xfer * pp_last = &sc->sc_isoc_p_last[0]; } if (*plen > xfer->max_frame_size) { -#if USB_DEBUG +#ifdef USB_DEBUG if (once) { once = 0; printf("%s: frame length(%d) exceeds %d " @@ -2306,7 +2306,7 @@ uhci_device_isoc_enter(struct usb_xfer * usb_pc_cpu_flush(td->page_cache); -#if USB_DEBUG +#ifdef USB_DEBUG if (uhcidebug > 5) { DPRINTF("TD %d\n", nframes); uhci_dump_td(td); Modified: stable/8/sys/dev/usb/controller/uss820dci.c ============================================================================== --- stable/8/sys/dev/usb/controller/uss820dci.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/controller/uss820dci.c Thu Apr 29 22:44:04 2010 (r207399) @@ -77,7 +77,7 @@ #define USS820_DCI_PC2SC(pc) \ USS820_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) -#if USB_DEBUG +#ifdef USB_DEBUG static int uss820dcidebug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uss820dci, CTLFLAG_RW, 0, "USB uss820dci"); Modified: stable/8/sys/dev/usb/input/atp.c ============================================================================== --- stable/8/sys/dev/usb/input/atp.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/input/atp.c Thu Apr 29 22:44:04 2010 (r207399) @@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$"); /* Tunables */ SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp"); -#if USB_DEBUG +#ifdef USB_DEBUG enum atp_log_level { ATP_LLEVEL_DISABLED = 0, ATP_LLEVEL_ERROR, @@ -126,7 +126,7 @@ enum atp_log_level { static int atp_debug = ATP_LLEVEL_ERROR; /* the default is to only log errors */ SYSCTL_INT(_hw_usb_atp, OID_AUTO, debug, CTLFLAG_RW, &atp_debug, ATP_LLEVEL_ERROR, "ATP debug level"); -#endif /* #if USB_DEBUG */ +#endif /* USB_DEBUG */ static u_int atp_touch_timeout = ATP_TOUCH_TIMEOUT; SYSCTL_INT(_hw_usb_atp, OID_AUTO, touch_timeout, CTLFLAG_RW, &atp_touch_timeout, @@ -1055,7 +1055,7 @@ atp_update_strokes(struct atp_softc *sc, if (pspans_y[j].matched == FALSE) break; } if ((i < n_xpspans) && (j < n_ypspans)) { -#if USB_DEBUG +#ifdef USB_DEBUG if (atp_debug >= ATP_LLEVEL_INFO) { printf("unmatched pspans:"); for (; i < n_xpspans; i++) { @@ -1072,7 +1072,7 @@ atp_update_strokes(struct atp_softc *sc, } printf("\n"); } -#endif /* #if USB_DEBUG */ +#endif /* USB_DEBUG */ if ((n_xpspans == 1) && (n_ypspans == 1)) /* The common case of a single pair of new pspans. */ atp_add_stroke(sc, &pspans_x[0], &pspans_y[0]); @@ -1082,7 +1082,7 @@ atp_update_strokes(struct atp_softc *sc, pspans_y, n_ypspans); } -#if USB_DEBUG +#ifdef USB_DEBUG if (atp_debug >= ATP_LLEVEL_INFO) { for (i = 0; i < sc->sc_n_strokes; i++) { atp_stroke *stroke = &sc->sc_strokes[i]; @@ -1110,7 +1110,7 @@ atp_update_strokes(struct atp_softc *sc, if (sc->sc_n_strokes) printf("\n"); } -#endif /* #if USB_DEBUG */ +#endif /* USB_DEBUG */ return (movement); } Modified: stable/8/sys/dev/usb/input/uhid.c ============================================================================== --- stable/8/sys/dev/usb/input/uhid.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/input/uhid.c Thu Apr 29 22:44:04 2010 (r207399) @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if USB_DEBUG +#ifdef USB_DEBUG static int uhid_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uhid, CTLFLAG_RW, 0, "USB uhid"); Modified: stable/8/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/8/sys/dev/usb/input/ukbd.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/input/ukbd.c Thu Apr 29 22:44:04 2010 (r207399) @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$"); /* the following file must be included after "ukbdmap.h" */ #include -#if USB_DEBUG +#ifdef USB_DEBUG static int ukbd_debug = 0; static int ukbd_no_leds = 0; @@ -621,7 +621,7 @@ ukbd_intr_callback(struct usb_xfer *xfer apple_fn = 1; else apple_fn = 0; -#if USB_DEBUG +#ifdef USB_DEBUG DPRINTF("apple_eject=%u apple_fn=%u\n", apple_eject, apple_fn); @@ -687,7 +687,7 @@ ukbd_set_leds_callback(struct usb_xfer * uint8_t buf[2]; struct ukbd_softc *sc = usbd_xfer_softc(xfer); -#if USB_DEBUG +#ifdef USB_DEBUG if (ukbd_no_leds) return; #endif Modified: stable/8/sys/dev/usb/input/ums.c ============================================================================== --- stable/8/sys/dev/usb/input/ums.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/input/ums.c Thu Apr 29 22:44:04 2010 (r207399) @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if USB_DEBUG +#ifdef USB_DEBUG static int ums_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW, 0, "USB ums"); @@ -501,7 +501,9 @@ ums_attach(device_t dev) int err; uint16_t d_len; uint8_t i; +#ifdef USB_DEBUG uint8_t j; +#endif DPRINTFN(11, "sc=%p\n", sc); @@ -595,7 +597,7 @@ ums_attach(device_t dev) free(d_ptr, M_TEMP); d_ptr = NULL; -#if USB_DEBUG +#ifdef USB_DEBUG for (j = 0; j < UMS_INFO_MAX; j++) { info = &sc->sc_info[j]; Modified: stable/8/sys/dev/usb/misc/udbp.c ============================================================================== --- stable/8/sys/dev/usb/misc/udbp.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/misc/udbp.c Thu Apr 29 22:44:04 2010 (r207399) @@ -94,7 +94,7 @@ __FBSDID("$FreeBSD$"); #include -#if USB_DEBUG +#ifdef USB_DEBUG static int udbp_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, udbp, CTLFLAG_RW, 0, "USB udbp"); Modified: stable/8/sys/dev/usb/net/if_aue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_aue.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/net/if_aue.c Thu Apr 29 22:44:04 2010 (r207399) @@ -100,7 +100,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if USB_DEBUG +#ifdef USB_DEBUG static int aue_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, aue, CTLFLAG_RW, 0, "USB aue"); Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/net/if_axe.c Thu Apr 29 22:44:04 2010 (r207399) @@ -123,7 +123,7 @@ __FBSDID("$FreeBSD$"); */ #define AXE_178_MAX_FRAME_BURST 1 -#if USB_DEBUG +#ifdef USB_DEBUG static int axe_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, axe, CTLFLAG_RW, 0, "USB axe"); Modified: stable/8/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/8/sys/dev/usb/net/if_cdce.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/net/if_cdce.c Thu Apr 29 22:44:04 2010 (r207399) @@ -108,7 +108,7 @@ static uether_fn_t cdce_setpromisc; static uint32_t cdce_m_crc32(struct mbuf *, uint32_t, uint32_t); -#if USB_DEBUG +#ifdef USB_DEBUG static int cdce_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW, 0, "USB CDC-Ethernet"); Modified: stable/8/sys/dev/usb/net/if_cue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_cue.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/net/if_cue.c Thu Apr 29 22:44:04 2010 (r207399) @@ -122,7 +122,7 @@ static int cue_getmac(struct cue_softc * static uint32_t cue_mchash(const uint8_t *); static void cue_reset(struct cue_softc *); -#if USB_DEBUG +#ifdef USB_DEBUG static int cue_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, cue, CTLFLAG_RW, 0, "USB cue"); Modified: stable/8/sys/dev/usb/net/if_kue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_kue.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/net/if_kue.c Thu Apr 29 22:44:04 2010 (r207399) @@ -163,7 +163,7 @@ static int kue_ctl(struct kue_softc *, u static int kue_load_fw(struct kue_softc *); static void kue_reset(struct kue_softc *); -#if USB_DEBUG +#ifdef USB_DEBUG static int kue_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, kue, CTLFLAG_RW, 0, "USB kue"); Modified: stable/8/sys/dev/usb/net/if_rue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_rue.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/net/if_rue.c Thu Apr 29 22:44:04 2010 (r207399) @@ -97,7 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if USB_DEBUG +#ifdef USB_DEBUG static int rue_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, rue, CTLFLAG_RW, 0, "USB rue"); Modified: stable/8/sys/dev/usb/net/if_udav.c ============================================================================== --- stable/8/sys/dev/usb/net/if_udav.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/net/if_udav.c Thu Apr 29 22:44:04 2010 (r207399) @@ -185,7 +185,7 @@ static const struct usb_ether_methods ud .ue_mii_sts = udav_ifmedia_status, }; -#if USB_DEBUG +#ifdef USB_DEBUG static int udav_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, udav, CTLFLAG_RW, 0, "USB udav"); Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/u3g.c Thu Apr 29 22:44:04 2010 (r207399) @@ -63,7 +63,7 @@ #include -#if USB_DEBUG +#ifdef USB_DEBUG static int u3g_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, u3g, CTLFLAG_RW, 0, "USB 3g"); Modified: stable/8/sys/dev/usb/serial/ubsa.c ============================================================================== --- stable/8/sys/dev/usb/serial/ubsa.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/ubsa.c Thu Apr 29 22:44:04 2010 (r207399) @@ -93,7 +93,7 @@ __FBSDID("$FreeBSD$"); #include -#if USB_DEBUG +#ifdef USB_DEBUG static int ubsa_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW, 0, "USB ubsa"); @@ -405,9 +405,8 @@ ubsa_cfg_set_break(struct ucom_softc *uc static int ubsa_pre_param(struct ucom_softc *ucom, struct termios *t) { - struct ubsa_softc *sc = ucom->sc_parent; - DPRINTF("sc = %p\n", sc); + DPRINTF("sc = %p\n", ucom->sc_parent); switch (t->c_ospeed) { case B0: Modified: stable/8/sys/dev/usb/serial/ubser.c ============================================================================== --- stable/8/sys/dev/usb/serial/ubser.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/ubser.c Thu Apr 29 22:44:04 2010 (r207399) @@ -115,7 +115,7 @@ __FBSDID("$FreeBSD$"); #define VENDOR_SET_BREAK 0x02 #define VENDOR_CLEAR_BREAK 0x03 -#if USB_DEBUG +#ifdef USB_DEBUG static int ubser_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ubser, CTLFLAG_RW, 0, "USB ubser"); Modified: stable/8/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uchcom.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/uchcom.c Thu Apr 29 22:44:04 2010 (r207399) @@ -101,7 +101,7 @@ __FBSDID("$FreeBSD$"); #include -#if USB_DEBUG +#ifdef USB_DEBUG static int uchcom_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uchcom, CTLFLAG_RW, 0, "USB uchcom"); Modified: stable/8/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/8/sys/dev/usb/serial/uftdi.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/uftdi.c Thu Apr 29 22:44:04 2010 (r207399) @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if USB_DEBUG +#ifdef USB_DEBUG static int uftdi_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi"); Modified: stable/8/sys/dev/usb/serial/ulpt.c ============================================================================== --- stable/8/sys/dev/usb/serial/ulpt.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/ulpt.c Thu Apr 29 22:44:04 2010 (r207399) @@ -79,7 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if USB_DEBUG +#ifdef USB_DEBUG static int ulpt_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ulpt, CTLFLAG_RW, 0, "USB ulpt"); Modified: stable/8/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/8/sys/dev/usb/serial/umodem.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/umodem.c Thu Apr 29 22:44:04 2010 (r207399) @@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$"); #include -#if USB_DEBUG +#ifdef USB_DEBUG static int umodem_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, umodem, CTLFLAG_RW, 0, "USB umodem"); Modified: stable/8/sys/dev/usb/serial/umoscom.c ============================================================================== --- stable/8/sys/dev/usb/serial/umoscom.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/umoscom.c Thu Apr 29 22:44:04 2010 (r207399) @@ -48,7 +48,7 @@ #include -#if USB_DEBUG +#ifdef USB_DEBUG static int umoscom_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, umoscom, CTLFLAG_RW, 0, "USB umoscom"); Modified: stable/8/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uplcom.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/uplcom.c Thu Apr 29 22:44:04 2010 (r207399) @@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$"); #include -#if USB_DEBUG +#ifdef USB_DEBUG static int uplcom_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uplcom, CTLFLAG_RW, 0, "USB uplcom"); Modified: stable/8/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/8/sys/dev/usb/serial/usb_serial.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/usb_serial.c Thu Apr 29 22:44:04 2010 (r207399) @@ -104,7 +104,7 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, "USB ucom"); -#if USB_DEBUG +#ifdef USB_DEBUG static int ucom_debug = 0; SYSCTL_INT(_hw_usb_ucom, OID_AUTO, debug, CTLFLAG_RW, Modified: stable/8/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uslcom.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/uslcom.c Thu Apr 29 22:44:04 2010 (r207399) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include -#if USB_DEBUG +#ifdef USB_DEBUG static int uslcom_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uslcom, CTLFLAG_RW, 0, "USB uslcom"); Modified: stable/8/sys/dev/usb/serial/uvisor.c ============================================================================== --- stable/8/sys/dev/usb/serial/uvisor.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/uvisor.c Thu Apr 29 22:44:04 2010 (r207399) @@ -85,7 +85,7 @@ #include -#if USB_DEBUG +#ifdef USB_DEBUG static int uvisor_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uvisor, CTLFLAG_RW, 0, "USB uvisor"); @@ -399,7 +399,7 @@ uvisor_init(struct uvisor_softc *sc, str goto done; } } -#if USB_DEBUG +#ifdef USB_DEBUG if (sc->sc_flag & UVISOR_FLAG_VISOR) { uint16_t i, np; const char *desc; Modified: stable/8/sys/dev/usb/serial/uvscom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uvscom.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/serial/uvscom.c Thu Apr 29 22:44:04 2010 (r207399) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include -#if USB_DEBUG +#ifdef USB_DEBUG static int uvscom_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uvscom, CTLFLAG_RW, 0, "USB uvscom"); Modified: stable/8/sys/dev/usb/storage/umass.c ============================================================================== --- stable/8/sys/dev/usb/storage/umass.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/storage/umass.c Thu Apr 29 22:44:04 2010 (r207399) @@ -146,7 +146,7 @@ __FBSDID("$FreeBSD$"); #define UMASS_USB_FLAGS #endif -#if USB_DEBUG +#ifdef USB_DEBUG #define DIF(m, x) \ do { \ if (umass_debug & (m)) { x ; } \ @@ -488,7 +488,7 @@ static uint8_t umass_no_transform(struct static uint8_t umass_std_transform(struct umass_softc *, union ccb *, uint8_t *, uint8_t); -#if USB_DEBUG +#ifdef USB_DEBUG static void umass_bbb_dump_cbw(struct umass_softc *, umass_bbb_cbw_t *); static void umass_bbb_dump_csw(struct umass_softc *, umass_bbb_csw_t *); static void umass_cbi_dump_cmd(struct umass_softc *, void *, uint8_t); @@ -917,7 +917,7 @@ umass_attach(device_t dev) } sc->sc_iface_no = id->bInterfaceNumber; -#if USB_DEBUG +#ifdef USB_DEBUG device_printf(dev, " "); switch (sc->sc_proto & UMASS_PROTO_COMMAND) { @@ -3012,7 +3012,7 @@ umass_std_transform(struct umass_softc * return (1); } -#if USB_DEBUG +#ifdef USB_DEBUG static void umass_bbb_dump_cbw(struct umass_softc *sc, umass_bbb_cbw_t *cbw) { Modified: stable/8/sys/dev/usb/storage/urio.c ============================================================================== --- stable/8/sys/dev/usb/storage/urio.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/storage/urio.c Thu Apr 29 22:44:04 2010 (r207399) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #include -#if USB_DEBUG +#ifdef USB_DEBUG static int urio_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, urio, CTLFLAG_RW, 0, "USB urio"); Modified: stable/8/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- stable/8/sys/dev/usb/storage/ustorage_fs.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/storage/ustorage_fs.c Thu Apr 29 22:44:04 2010 (r207399) @@ -64,7 +64,7 @@ #define USB_DEBUG_VAR ustorage_fs_debug #include -#if USB_DEBUG +#ifdef USB_DEBUG static int ustorage_fs_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ustorage_fs, CTLFLAG_RW, 0, "USB ustorage_fs"); Modified: stable/8/sys/dev/usb/usb_debug.h ============================================================================== --- stable/8/sys/dev/usb/usb_debug.h Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/usb_debug.h Thu Apr 29 22:44:04 2010 (r207399) @@ -34,7 +34,7 @@ extern int usb_debug; /* Check if USB debugging is enabled. */ #ifdef USB_DEBUG_VAR -#if (USB_DEBUG != 0) +#ifdef USB_DEBUG #define DPRINTFN(n,fmt,...) do { \ if ((USB_DEBUG_VAR) >= (n)) { \ printf("%s: " fmt, \ Modified: stable/8/sys/dev/usb/usb_freebsd.h ============================================================================== --- stable/8/sys/dev/usb/usb_freebsd.h Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/usb_freebsd.h Thu Apr 29 22:44:04 2010 (r207399) @@ -57,10 +57,6 @@ #define USB_HUB_MAX_DEPTH 5 #define USB_EP0_BUFSIZE 1024 /* bytes */ -#ifndef USB_DEBUG -#define USB_DEBUG 1 -#endif - typedef uint32_t usb_timeout_t; /* milliseconds */ typedef uint32_t usb_frlength_t; /* bytes */ typedef uint32_t usb_frcount_t; /* units */ Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Thu Apr 29 22:42:18 2010 (r207398) +++ stable/8/sys/dev/usb/usb_request.c Thu Apr 29 22:44:04 2010 (r207399) @@ -68,7 +68,7 @@ #include #include -#if USB_DEBUG +#ifdef USB_DEBUG static int usb_pr_poll_delay = USB_PORT_RESET_DELAY; static int usb_pr_recovery_delay = USB_PORT_RESET_RECOVERY; static int usb_ss_delay = 0; @@ -433,7 +433,7 @@ usbd_do_request_flags(struct usb_device } else { if (xfer->frlengths[0] == 0) { if (xfer->flags.manual_status) { -#if USB_DEBUG +#ifdef USB_DEBUG int temp; temp = usb_ss_delay; @@ -603,7 +603,7 @@ usbd_req_reset_port(struct usb_device *u usb_error_t err; uint16_t n; -#if USB_DEBUG +#ifdef USB_DEBUG uint16_t pr_poll_delay; uint16_t pr_recovery_delay; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 22:47:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1EAF1065670; Thu, 29 Apr 2010 22:47:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id CF7468FC14; Thu, 29 Apr 2010 22:47: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 o3TMl13w081728; Thu, 29 Apr 2010 22:47:01 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TMl1XA081726; Thu, 29 Apr 2010 22:47:01 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201004292247.o3TMl1XA081726@svn.freebsd.org> From: Andrew Thompson Date: Thu, 29 Apr 2010 22:47:01 +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: r207400 - stable/8/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 22:47:02 -0000 Author: thompsa Date: Thu Apr 29 22:47:01 2010 New Revision: 207400 URL: http://svn.freebsd.org/changeset/base/207400 Log: MFC r207078 Use SX_DUPOK rather than making the string unique. Modified: stable/8/sys/dev/usb/usb_device.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Thu Apr 29 22:44:04 2010 (r207399) +++ stable/8/sys/dev/usb/usb_device.c Thu Apr 29 22:47:01 2010 (r207400) @@ -1491,10 +1491,10 @@ usb_alloc_device(device_t parent_dev, st return (NULL); } /* initialise our SX-lock */ - sx_init(udev->default_sx, "0123456789ABCDEF - USB device SX lock" + depth); + sx_init_flags(udev->default_sx, "USB device SX lock", SX_DUPOK); /* initialise our SX-lock */ - sx_init(udev->default_sx + 1, "0123456789ABCDEF - USB config SX lock" + depth); + sx_init_flags(udev->default_sx + 1, "USB config SX lock", SX_DUPOK); cv_init(udev->default_cv, "WCTRL"); cv_init(udev->default_cv + 1, "UGONE"); From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 22:48:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4DAE8106564A; Thu, 29 Apr 2010 22:48:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7618FC1A; Thu, 29 Apr 2010 22:48:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3TMmKOc082082; Thu, 29 Apr 2010 22:48:20 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TMmKtS082076; Thu, 29 Apr 2010 22:48:20 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201004292248.o3TMmKtS082076@svn.freebsd.org> From: Andrew Thompson Date: Thu, 29 Apr 2010 22:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207402 - stable/8/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 22:48:20 -0000 Author: thompsa Date: Thu Apr 29 22:48:19 2010 New Revision: 207402 URL: http://svn.freebsd.org/changeset/base/207402 Log: MFC r207079 Properly name the sxlocks, mutexes and condvars. Modified: stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_device.h stable/8/sys/dev/usb/usb_request.c stable/8/sys/dev/usb/usb_transfer.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/usb/usb_dev.c ============================================================================== --- stable/8/sys/dev/usb/usb_dev.c Thu Apr 29 22:48:16 2010 (r207401) +++ stable/8/sys/dev/usb/usb_dev.c Thu Apr 29 22:48:19 2010 (r207402) @@ -284,7 +284,7 @@ error: usbd_enum_unlock(cpd->udev); if (--(cpd->udev->refcount) == 0) { - cv_signal(cpd->udev->default_cv + 1); + cv_signal(&cpd->udev->ref_cv); } } mtx_unlock(&usb_ref_lock); @@ -352,7 +352,7 @@ usb_unref_device(struct usb_cdev_privdat } if (crd->is_uref) { if (--(cpd->udev->refcount) == 0) { - cv_signal(cpd->udev->default_cv + 1); + cv_signal(&cpd->udev->ref_cv); } crd->is_uref = 0; } @@ -500,7 +500,7 @@ usb_fifo_create(struct usb_cdev_privdata /* update some fields */ f->fifo_index = n + USB_FIFO_TX; f->dev_ep_index = e; - f->priv_mtx = udev->default_mtx; + f->priv_mtx = &udev->device_mtx; f->priv_sc0 = ep; f->methods = &usb_ugen_methods; f->iface_index = ep->iface_index; @@ -527,7 +527,7 @@ usb_fifo_create(struct usb_cdev_privdata /* update some fields */ f->fifo_index = n + USB_FIFO_RX; f->dev_ep_index = e; - f->priv_mtx = udev->default_mtx; + f->priv_mtx = &udev->device_mtx; f->priv_sc0 = ep; f->methods = &usb_ugen_methods; f->iface_index = ep->iface_index; Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Thu Apr 29 22:48:16 2010 (r207401) +++ stable/8/sys/dev/usb/usb_device.c Thu Apr 29 22:48:19 2010 (r207402) @@ -655,7 +655,7 @@ usb_config_parse(struct usb_device *udev goto cleanup; if (cmd == USB_CFG_INIT) { - sx_assert(udev->default_sx + 1, SA_LOCKED); + sx_assert(&udev->enum_sx, SA_LOCKED); /* check for in-use endpoints */ @@ -1062,7 +1062,7 @@ usb_detach_device(struct usb_device *ude } DPRINTFN(4, "udev=%p\n", udev); - sx_assert(udev->default_sx + 1, SA_LOCKED); + sx_assert(&udev->enum_sx, SA_LOCKED); /* * First detach the child to give the child's detach routine a @@ -1380,7 +1380,7 @@ usb_suspend_resume(struct usb_device *ud } DPRINTFN(4, "udev=%p do_suspend=%d\n", udev, do_suspend); - sx_assert(udev->default_sx + 1, SA_LOCKED); + sx_assert(&udev->enum_sx, SA_LOCKED); USB_BUS_LOCK(udev->bus); /* filter the suspend events */ @@ -1419,13 +1419,13 @@ usbd_clear_stall_proc(struct usb_proc_ms /* Change lock */ USB_BUS_UNLOCK(udev->bus); - mtx_lock(udev->default_mtx); + mtx_lock(&udev->device_mtx); /* Start clear stall callback */ usbd_transfer_start(udev->default_xfer[1]); /* Change lock */ - mtx_unlock(udev->default_mtx); + mtx_unlock(&udev->device_mtx); USB_BUS_LOCK(udev->bus); } @@ -1491,16 +1491,16 @@ usb_alloc_device(device_t parent_dev, st return (NULL); } /* initialise our SX-lock */ - sx_init_flags(udev->default_sx, "USB device SX lock", SX_DUPOK); + sx_init_flags(&udev->ctrl_sx, "USB device SX lock", SX_DUPOK); /* initialise our SX-lock */ - sx_init_flags(udev->default_sx + 1, "USB config SX lock", SX_DUPOK); + sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK); - cv_init(udev->default_cv, "WCTRL"); - cv_init(udev->default_cv + 1, "UGONE"); + cv_init(&udev->ctrlreq_cv, "WCTRL"); + cv_init(&udev->ref_cv, "UGONE"); /* initialise our mutex */ - mtx_init(udev->default_mtx, "USB device mutex", NULL, MTX_DEF); + mtx_init(&udev->device_mtx, "USB device mutex", NULL, MTX_DEF); /* initialise generic clear stall */ udev->cs_msg[0].hdr.pm_callback = &usbd_clear_stall_proc; @@ -2005,7 +2005,7 @@ usb_free_device(struct usb_device *udev, mtx_lock(&usb_ref_lock); udev->refcount--; while (udev->refcount != 0) { - cv_wait(udev->default_cv + 1, &usb_ref_lock); + cv_wait(&udev->ref_cv, &usb_ref_lock); } mtx_unlock(&usb_ref_lock); @@ -2036,13 +2036,13 @@ usb_free_device(struct usb_device *udev, &udev->cs_msg[0], &udev->cs_msg[1]); USB_BUS_UNLOCK(udev->bus); - sx_destroy(udev->default_sx); - sx_destroy(udev->default_sx + 1); + sx_destroy(&udev->ctrl_sx); + sx_destroy(&udev->enum_sx); - cv_destroy(udev->default_cv); - cv_destroy(udev->default_cv + 1); + cv_destroy(&udev->ctrlreq_cv); + cv_destroy(&udev->ref_cv); - mtx_destroy(udev->default_mtx); + mtx_destroy(&udev->device_mtx); #if USB_HAVE_UGEN KASSERT(LIST_FIRST(&udev->pd_list) == NULL, ("leaked cdev entries")); #endif @@ -2588,7 +2588,7 @@ usbd_device_attached(struct usb_device * void usbd_enum_lock(struct usb_device *udev) { - sx_xlock(udev->default_sx + 1); + sx_xlock(&udev->enum_sx); /* * NEWBUS LOCK NOTE: We should check if any parent SX locks * are locked before locking Giant. Else the lock can be @@ -2603,7 +2603,7 @@ void usbd_enum_unlock(struct usb_device *udev) { mtx_unlock(&Giant); - sx_xunlock(udev->default_sx + 1); + sx_xunlock(&udev->enum_sx); } /* @@ -2614,5 +2614,5 @@ usbd_enum_unlock(struct usb_device *udev uint8_t usbd_enum_is_locked(struct usb_device *udev) { - return (sx_xlocked(udev->default_sx + 1)); + return (sx_xlocked(&udev->enum_sx)); } Modified: stable/8/sys/dev/usb/usb_device.h ============================================================================== --- stable/8/sys/dev/usb/usb_device.h Thu Apr 29 22:48:16 2010 (r207401) +++ stable/8/sys/dev/usb/usb_device.h Thu Apr 29 22:48:19 2010 (r207402) @@ -113,9 +113,11 @@ struct usb_power_save { struct usb_device { struct usb_clear_stall_msg cs_msg[2]; /* generic clear stall * messages */ - struct sx default_sx[2]; - struct mtx default_mtx[1]; - struct cv default_cv[2]; + struct sx ctrl_sx; + struct sx enum_sx; + struct mtx device_mtx; + struct cv ctrlreq_cv; + struct cv ref_cv; struct usb_interface *ifaces; struct usb_endpoint default_ep; /* Control Endpoint 0 */ struct usb_endpoint *endpoints; Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Thu Apr 29 22:48:16 2010 (r207401) +++ stable/8/sys/dev/usb/usb_request.c Thu Apr 29 22:48:19 2010 (r207402) @@ -99,7 +99,7 @@ usbd_do_request_callback(struct usb_xfer usbd_transfer_submit(xfer); break; default: - cv_signal(xfer->xroot->udev->default_cv); + cv_signal(&xfer->xroot->udev->ctrlreq_cv); break; } } @@ -319,7 +319,7 @@ usbd_do_request_flags(struct usb_device * is achieved when multiple threads are involved: */ - sx_xlock(udev->default_sx); + sx_xlock(&udev->ctrl_sx); hr_func = usbd_get_hr_func(udev); @@ -457,7 +457,7 @@ usbd_do_request_flags(struct usb_device usbd_transfer_start(xfer); while (usbd_transfer_pending(xfer)) { - cv_wait(udev->default_cv, + cv_wait(&udev->ctrlreq_cv, xfer->xroot->xfer_mtx); } @@ -534,7 +534,7 @@ usbd_do_request_flags(struct usb_device USB_XFER_UNLOCK(xfer); done: - sx_xunlock(udev->default_sx); + sx_xunlock(&udev->ctrl_sx); if (mtx) { mtx_lock(mtx); Modified: stable/8/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.c Thu Apr 29 22:48:16 2010 (r207401) +++ stable/8/sys/dev/usb/usb_transfer.c Thu Apr 29 22:48:19 2010 (r207402) @@ -2821,7 +2821,7 @@ repeat: iface_index = 0; if (usbd_transfer_setup(udev, &iface_index, udev->default_xfer, usb_control_ep_cfg, USB_DEFAULT_XFER_MAX, NULL, - udev->default_mtx)) { + &udev->device_mtx)) { DPRINTFN(0, "could not setup default " "USB transfer\n"); } else { From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 22:49:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66CEC106566C; Thu, 29 Apr 2010 22:49:21 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 538EA8FC17; Thu, 29 Apr 2010 22:49:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3TMnLPN082369; Thu, 29 Apr 2010 22:49:21 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TMnLph082359; Thu, 29 Apr 2010 22:49:21 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201004292249.o3TMnLph082359@svn.freebsd.org> From: Andrew Thompson Date: Thu, 29 Apr 2010 22:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207403 - stable/8/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 22:49:21 -0000 Author: thompsa Date: Thu Apr 29 22:49:21 2010 New Revision: 207403 URL: http://svn.freebsd.org/changeset/base/207403 Log: MFC r207080 Use a more obvious prefix for the USB control (endpoint 0) transfers rather than default_*. Modified: stable/8/sys/dev/usb/usb_compat_linux.c stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_device.h stable/8/sys/dev/usb/usb_generic.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usb_request.c stable/8/sys/dev/usb/usb_transfer.c stable/8/sys/dev/usb/usb_transfer.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/usb/usb_compat_linux.c ============================================================================== --- stable/8/sys/dev/usb/usb_compat_linux.c Thu Apr 29 22:48:19 2010 (r207402) +++ stable/8/sys/dev/usb/usb_compat_linux.c Thu Apr 29 22:49:21 2010 (r207403) @@ -971,7 +971,7 @@ usb_linux_create_usb_device(struct usb_d udev->devnum = device_get_unit(dev); bcopy(&udev->ddesc, &udev->descriptor, sizeof(udev->descriptor)); - bcopy(udev->default_ep.edesc, &udev->ep0.desc, + bcopy(udev->ctrl_ep.edesc, &udev->ep0.desc, sizeof(udev->ep0.desc)); } } Modified: stable/8/sys/dev/usb/usb_dev.c ============================================================================== --- stable/8/sys/dev/usb/usb_dev.c Thu Apr 29 22:48:19 2010 (r207402) +++ stable/8/sys/dev/usb/usb_dev.c Thu Apr 29 22:49:21 2010 (r207403) @@ -615,7 +615,7 @@ usb_dev_get_ep(struct usb_device *udev, uint8_t ep_dir; if (ep_index == 0) { - ep = &udev->default_ep; + ep = &udev->ctrl_ep; } else { if (dir == USB_FIFO_RX) { if (udev->flags.usb_mode == USB_MODE_HOST) { Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Thu Apr 29 22:48:19 2010 (r207402) +++ stable/8/sys/dev/usb/usb_device.c Thu Apr 29 22:49:21 2010 (r207403) @@ -179,9 +179,9 @@ usbd_get_ep_by_addr(struct usb_device *u /* * The default endpoint is always present and is checked separately: */ - if ((udev->default_ep.edesc) && - ((udev->default_ep.edesc->bEndpointAddress & EA_MASK) == ea_val)) { - ep = &udev->default_ep; + if ((udev->ctrl_ep.edesc) && + ((udev->ctrl_ep.edesc->bEndpointAddress & EA_MASK) == ea_val)) { + ep = &udev->ctrl_ep; goto found; } return (NULL); @@ -297,11 +297,11 @@ usbd_get_endpoint(struct usb_device *ude * address" and "any direction" returns the first endpoint of the * interface. "iface_index" and "direction" is ignored: */ - if ((udev->default_ep.edesc) && - ((udev->default_ep.edesc->bEndpointAddress & ea_mask) == ea_val) && - ((udev->default_ep.edesc->bmAttributes & type_mask) == type_val) && + if ((udev->ctrl_ep.edesc) && + ((udev->ctrl_ep.edesc->bEndpointAddress & ea_mask) == ea_val) && + ((udev->ctrl_ep.edesc->bmAttributes & type_mask) == type_val) && (!index)) { - ep = &udev->default_ep; + ep = &udev->ctrl_ep; goto found; } return (NULL); @@ -1422,7 +1422,7 @@ usbd_clear_stall_proc(struct usb_proc_ms mtx_lock(&udev->device_mtx); /* Start clear stall callback */ - usbd_transfer_start(udev->default_xfer[1]); + usbd_transfer_start(udev->ctrl_xfer[1]); /* Change lock */ mtx_unlock(&udev->device_mtx); @@ -1529,13 +1529,13 @@ usb_alloc_device(device_t parent_dev, st udev->refcount = 1; /* set up default endpoint descriptor */ - udev->default_ep_desc.bLength = sizeof(udev->default_ep_desc); - udev->default_ep_desc.bDescriptorType = UDESC_ENDPOINT; - udev->default_ep_desc.bEndpointAddress = USB_CONTROL_ENDPOINT; - udev->default_ep_desc.bmAttributes = UE_CONTROL; - udev->default_ep_desc.wMaxPacketSize[0] = USB_MAX_IPACKET; - udev->default_ep_desc.wMaxPacketSize[1] = 0; - udev->default_ep_desc.bInterval = 0; + udev->ctrl_ep_desc.bLength = sizeof(udev->ctrl_ep_desc); + udev->ctrl_ep_desc.bDescriptorType = UDESC_ENDPOINT; + udev->ctrl_ep_desc.bEndpointAddress = USB_CONTROL_ENDPOINT; + udev->ctrl_ep_desc.bmAttributes = UE_CONTROL; + udev->ctrl_ep_desc.wMaxPacketSize[0] = USB_MAX_IPACKET; + udev->ctrl_ep_desc.wMaxPacketSize[1] = 0; + udev->ctrl_ep_desc.bInterval = 0; udev->ddesc.bMaxPacketSize = USB_MAX_IPACKET; udev->speed = speed; @@ -1559,8 +1559,8 @@ usb_alloc_device(device_t parent_dev, st /* init the default endpoint */ usb_init_endpoint(udev, 0, - &udev->default_ep_desc, - &udev->default_ep); + &udev->ctrl_ep_desc, + &udev->ctrl_ep); /* set device index */ udev->device_index = device_index; @@ -1573,10 +1573,10 @@ usb_alloc_device(device_t parent_dev, st LIST_INIT(&udev->pd_list); /* Create the control endpoint device */ - udev->default_dev = usb_make_dev(udev, 0, FREAD|FWRITE); + udev->ctrl_dev = usb_make_dev(udev, 0, FREAD|FWRITE); /* Create a link from /dev/ugenX.X to the default endpoint */ - make_dev_alias(udev->default_dev, udev->ugen_name); + make_dev_alias(udev->ctrl_dev, udev->ugen_name); #endif if (udev->flags.usb_mode == USB_MODE_HOST) { @@ -2009,20 +2009,20 @@ usb_free_device(struct usb_device *udev, } mtx_unlock(&usb_ref_lock); - destroy_dev_sched_cb(udev->default_dev, usb_cdev_cleanup, - udev->default_dev->si_drv1); + destroy_dev_sched_cb(udev->ctrl_dev, usb_cdev_cleanup, + udev->ctrl_dev->si_drv1); #endif if (udev->flags.usb_mode == USB_MODE_DEVICE) { /* stop receiving any control transfers (Device Side Mode) */ - usbd_transfer_unsetup(udev->default_xfer, USB_DEFAULT_XFER_MAX); + usbd_transfer_unsetup(udev->ctrl_xfer, USB_CTRL_XFER_MAX); } /* the following will get the device unconfigured in software */ usb_unconfigure(udev, USB_UNCFG_FLAG_FREE_EP0); /* unsetup any leftover default USB transfers */ - usbd_transfer_unsetup(udev->default_xfer, USB_DEFAULT_XFER_MAX); + usbd_transfer_unsetup(udev->ctrl_xfer, USB_CTRL_XFER_MAX); /* template unsetup, if any */ (usb_temp_unsetup_p) (udev); Modified: stable/8/sys/dev/usb/usb_device.h ============================================================================== --- stable/8/sys/dev/usb/usb_device.h Thu Apr 29 22:48:19 2010 (r207402) +++ stable/8/sys/dev/usb/usb_device.h Thu Apr 29 22:49:21 2010 (r207403) @@ -30,7 +30,7 @@ struct usb_symlink; /* UGEN */ struct usb_device; /* linux compat */ -#define USB_DEFAULT_XFER_MAX 2 +#define USB_CTRL_XFER_MAX 2 /* "usb_parse_config()" commands */ @@ -119,7 +119,7 @@ struct usb_device { struct cv ctrlreq_cv; struct cv ref_cv; struct usb_interface *ifaces; - struct usb_endpoint default_ep; /* Control Endpoint 0 */ + struct usb_endpoint ctrl_ep; /* Control Endpoint 0 */ struct usb_endpoint *endpoints; struct usb_power_save pwr_save;/* power save data */ struct usb_bus *bus; /* our USB BUS */ @@ -128,13 +128,13 @@ struct usb_device { struct usb_device *parent_hs_hub; /* high-speed parent HUB */ struct usb_config_descriptor *cdesc; /* full config descr */ struct usb_hub *hub; /* only if this is a hub */ - struct usb_xfer *default_xfer[USB_DEFAULT_XFER_MAX]; + struct usb_xfer *ctrl_xfer[USB_CTRL_XFER_MAX]; struct usb_temp_data *usb_template_ptr; struct usb_endpoint *ep_curr; /* current clear stall endpoint */ #if USB_HAVE_UGEN struct usb_fifo *fifo[USB_FIFO_MAX]; struct usb_symlink *ugen_symlink; /* our generic symlink */ - struct cdev *default_dev; /* Control Endpoint 0 device node */ + struct cdev *ctrl_dev; /* Control Endpoint 0 device node */ LIST_HEAD(,usb_fs_privdata) pd_list; char ugen_name[20]; /* name of ugenX.X device */ #endif @@ -166,7 +166,7 @@ struct usb_device { struct usb_device_flags flags; - struct usb_endpoint_descriptor default_ep_desc; /* for endpoint 0 */ + struct usb_endpoint_descriptor ctrl_ep_desc; /* for endpoint 0 */ struct usb_device_descriptor ddesc; /* device descriptor */ char *serial; /* serial number */ Modified: stable/8/sys/dev/usb/usb_generic.c ============================================================================== --- stable/8/sys/dev/usb/usb_generic.c Thu Apr 29 22:48:19 2010 (r207402) +++ stable/8/sys/dev/usb/usb_generic.c Thu Apr 29 22:49:21 2010 (r207403) @@ -81,11 +81,11 @@ static usb_callback_t ugen_read_clear_stall_callback; static usb_callback_t ugen_write_clear_stall_callback; -static usb_callback_t ugen_default_read_callback; -static usb_callback_t ugen_default_write_callback; +static usb_callback_t ugen_ctrl_read_callback; +static usb_callback_t ugen_ctrl_write_callback; static usb_callback_t ugen_isoc_read_callback; static usb_callback_t ugen_isoc_write_callback; -static usb_callback_t ugen_default_fs_callback; +static usb_callback_t ugen_ctrl_fs_callback; static usb_fifo_open_t ugen_open; static usb_fifo_close_t ugen_close; @@ -265,7 +265,7 @@ ugen_open_pipe_write(struct usb_fifo *f) if (f->flag_short) { usb_config[0].flags.force_short_xfer = 1; } - usb_config[0].callback = &ugen_default_write_callback; + usb_config[0].callback = &ugen_ctrl_write_callback; usb_config[0].timeout = f->timeout; usb_config[0].frames = 1; usb_config[0].bufsize = f->bufsize; @@ -335,7 +335,7 @@ ugen_open_pipe_read(struct usb_fifo *f) } usb_config[0].timeout = f->timeout; usb_config[0].frames = 1; - usb_config[0].callback = &ugen_default_read_callback; + usb_config[0].callback = &ugen_ctrl_read_callback; usb_config[0].bufsize = f->bufsize; if (ugen_transfer_setup(f, usb_config, 2)) { @@ -401,7 +401,7 @@ ugen_stop_io(struct usb_fifo *f) } static void -ugen_default_read_callback(struct usb_xfer *xfer, usb_error_t error) +ugen_ctrl_read_callback(struct usb_xfer *xfer, usb_error_t error) { struct usb_fifo *f = usbd_xfer_softc(xfer); struct usb_mbuf *m; @@ -453,7 +453,7 @@ ugen_default_read_callback(struct usb_xf } static void -ugen_default_write_callback(struct usb_xfer *xfer, usb_error_t error) +ugen_ctrl_write_callback(struct usb_xfer *xfer, usb_error_t error) { struct usb_fifo *f = usbd_xfer_softc(xfer); usb_frlength_t actlen; @@ -1480,7 +1480,7 @@ ugen_ioctl(struct usb_fifo *f, u_long cm usb_config[0].direction = ed->bEndpointAddress & (UE_DIR_OUT | UE_DIR_IN); usb_config[0].interval = USB_DEFAULT_INTERVAL; usb_config[0].flags.proxy_buffer = 1; - usb_config[0].callback = &ugen_default_fs_callback; + usb_config[0].callback = &ugen_ctrl_fs_callback; usb_config[0].timeout = 0; /* no timeout */ usb_config[0].frames = u.popen->max_frames; usb_config[0].bufsize = u.popen->max_bufsize; @@ -2201,7 +2201,7 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo } static void -ugen_default_fs_callback(struct usb_xfer *xfer, usb_error_t error) +ugen_ctrl_fs_callback(struct usb_xfer *xfer, usb_error_t error) { ; /* workaround for a bug in "indent" */ Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Thu Apr 29 22:48:19 2010 (r207402) +++ stable/8/sys/dev/usb/usb_hub.c Thu Apr 29 22:49:21 2010 (r207403) @@ -246,7 +246,7 @@ uhub_explore_sub(struct uhub_softc *sc, /* start control transfer, if device mode */ if (child->flags.usb_mode == USB_MODE_DEVICE) { - usbd_default_transfer_setup(child); + usbd_ctrl_transfer_setup(child); } /* if a HUB becomes present, do a recursive HUB explore */ Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Thu Apr 29 22:48:19 2010 (r207402) +++ stable/8/sys/dev/usb/usb_request.c Thu Apr 29 22:49:21 2010 (r207403) @@ -374,9 +374,9 @@ usbd_do_request_flags(struct usb_device /* * Setup a new USB transfer or use the existing one, if any: */ - usbd_default_transfer_setup(udev); + usbd_ctrl_transfer_setup(udev); - xfer = udev->default_xfer[0]; + xfer = udev->ctrl_xfer[0]; if (xfer == NULL) { /* most likely out of memory */ err = USB_ERR_NOMEM; Modified: stable/8/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.c Thu Apr 29 22:48:19 2010 (r207402) +++ stable/8/sys/dev/usb/usb_transfer.c Thu Apr 29 22:49:21 2010 (r207403) @@ -72,7 +72,7 @@ struct usb_std_packet_size { static usb_callback_t usb_request_callback; -static const struct usb_config usb_control_ep_cfg[USB_DEFAULT_XFER_MAX] = { +static const struct usb_config usb_control_ep_cfg[USB_CTRL_XFER_MAX] = { /* This transfer is used for generic control endpoint transfers */ @@ -2433,8 +2433,8 @@ usbd_pipe_start(struct usb_xfer_queue *p if (udev->flags.usb_mode == USB_MODE_DEVICE) { (udev->bus->methods->set_stall) ( udev, NULL, ep, &did_stall); - } else if (udev->default_xfer[1]) { - info = udev->default_xfer[1]->xroot; + } else if (udev->ctrl_xfer[1]) { + info = udev->ctrl_xfer[1]->xroot; usb_proc_msignal( &info->bus->non_giant_callback_proc, &udev->cs_msg[0], &udev->cs_msg[1]); @@ -2757,13 +2757,13 @@ usb_command_wrapper(struct usb_xfer_queu } /*------------------------------------------------------------------------* - * usbd_default_transfer_setup + * usbd_ctrl_transfer_setup * * This function is used to setup the default USB control endpoint * transfer. *------------------------------------------------------------------------*/ void -usbd_default_transfer_setup(struct usb_device *udev) +usbd_ctrl_transfer_setup(struct usb_device *udev) { struct usb_xfer *xfer; uint8_t no_resetup; @@ -2774,12 +2774,12 @@ usbd_default_transfer_setup(struct usb_d return; repeat: - xfer = udev->default_xfer[0]; + xfer = udev->ctrl_xfer[0]; if (xfer) { USB_XFER_LOCK(xfer); no_resetup = ((xfer->address == udev->address) && - (udev->default_ep_desc.wMaxPacketSize[0] == + (udev->ctrl_ep_desc.wMaxPacketSize[0] == udev->ddesc.bMaxPacketSize)); if (udev->flags.usb_mode == USB_MODE_DEVICE) { if (no_resetup) { @@ -2806,13 +2806,13 @@ repeat: /* * Update wMaxPacketSize for the default control endpoint: */ - udev->default_ep_desc.wMaxPacketSize[0] = + udev->ctrl_ep_desc.wMaxPacketSize[0] = udev->ddesc.bMaxPacketSize; /* * Unsetup any existing USB transfer: */ - usbd_transfer_unsetup(udev->default_xfer, USB_DEFAULT_XFER_MAX); + usbd_transfer_unsetup(udev->ctrl_xfer, USB_CTRL_XFER_MAX); /* * Try to setup a new USB transfer for the @@ -2820,7 +2820,7 @@ repeat: */ iface_index = 0; if (usbd_transfer_setup(udev, &iface_index, - udev->default_xfer, usb_control_ep_cfg, USB_DEFAULT_XFER_MAX, NULL, + udev->ctrl_xfer, usb_control_ep_cfg, USB_CTRL_XFER_MAX, NULL, &udev->device_mtx)) { DPRINTFN(0, "could not setup default " "USB transfer\n"); @@ -3001,13 +3001,13 @@ usbd_transfer_poll(struct usb_xfer **ppx USB_BUS_LOCK(xroot->bus); /* check for clear stall */ - if (udev->default_xfer[1] != NULL) { + if (udev->ctrl_xfer[1] != NULL) { /* poll clear stall start */ pm = &udev->cs_msg[0].hdr; (pm->pm_callback) (pm); /* poll clear stall done thread */ - pm = &udev->default_xfer[1]-> + pm = &udev->ctrl_xfer[1]-> xroot->done_m[0].hdr; (pm->pm_callback) (pm); } Modified: stable/8/sys/dev/usb/usb_transfer.h ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.h Thu Apr 29 22:48:19 2010 (r207402) +++ stable/8/sys/dev/usb/usb_transfer.h Thu Apr 29 22:49:21 2010 (r207403) @@ -123,7 +123,7 @@ void usbd_transfer_done(struct usb_xfer void usbd_transfer_enqueue(struct usb_xfer_queue *pq, struct usb_xfer *xfer); void usbd_transfer_setup_sub(struct usb_setup_params *parm); -void usbd_default_transfer_setup(struct usb_device *udev); +void usbd_ctrl_transfer_setup(struct usb_device *udev); void usbd_clear_data_toggle(struct usb_device *udev, struct usb_endpoint *ep); usb_callback_t usbd_do_request_callback; From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 22:51:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10ABF106566B; Thu, 29 Apr 2010 22:51:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id F326F8FC08; Thu, 29 Apr 2010 22:51: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 o3TMpInQ082829; Thu, 29 Apr 2010 22:51:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TMpI79082827; Thu, 29 Apr 2010 22:51:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201004292251.o3TMpI79082827@svn.freebsd.org> From: Andrew Thompson Date: Thu, 29 Apr 2010 22:51: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: r207404 - head/sys/modules/usb/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 22:51:19 -0000 Author: thompsa Date: Thu Apr 29 22:51:18 2010 New Revision: 207404 URL: http://svn.freebsd.org/changeset/base/207404 Log: usb_controller.c requires opt_ddb.h Modified: head/sys/modules/usb/usb/Makefile Modified: head/sys/modules/usb/usb/Makefile ============================================================================== --- head/sys/modules/usb/usb/Makefile Thu Apr 29 22:49:21 2010 (r207403) +++ head/sys/modules/usb/usb/Makefile Thu Apr 29 22:51:18 2010 (r207404) @@ -31,7 +31,7 @@ S= ${.CURDIR}/../../.. KMOD= usb SRCS= bus_if.h device_if.h usb_if.h usb_if.c vnode_if.h \ - opt_usb.h opt_bus.h \ + opt_usb.h opt_bus.h opt_ddb.h \ usbdevs.h usbdevs_data.h \ usb_busdma.c usb_controller.c usb_compat_linux.c usb_core.c usb_debug.c \ usb_dev.c usb_device.c usb_dynamic.c usb_error.c usb_generic.c \ From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 23:48:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EDC3B106566C; Thu, 29 Apr 2010 23:48:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D98408FC14; Thu, 29 Apr 2010 23:48:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3TNm9sR095457; Thu, 29 Apr 2010 23:48:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TNm9Jf095450; Thu, 29 Apr 2010 23:48:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201004292348.o3TNm9Jf095450@svn.freebsd.org> From: Rick Macklem Date: Thu, 29 Apr 2010 23:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207406 - in stable/8/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 23:48:10 -0000 Author: rmacklem Date: Thu Apr 29 23:48:09 2010 New Revision: 207406 URL: http://svn.freebsd.org/changeset/base/207406 Log: MFC: r207082 When the experimental NFS client is handling an NFSv4 server reboot with delegations enabled, the recovery could fail if the renew thread is trying to return a delegation, since it will not do the recovery. This patch fixes the above by having nfscl_recalldeleg() fail with the I/O operations returning EIO, so that they will be attempted later. Most of the patch consists of adding an argument to various functions to indicate the delegation recall case where this needs to be done. Modified: stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfsclient/nfs.h stable/8/sys/fs/nfsclient/nfs_clbio.c stable/8/sys/fs/nfsclient/nfs_clnfsiod.c stable/8/sys/fs/nfsclient/nfs_clnode.c stable/8/sys/fs/nfsclient/nfs_clrpcops.c stable/8/sys/fs/nfsclient/nfs_clstate.c stable/8/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Thu Apr 29 23:22:38 2010 (r207405) +++ stable/8/sys/fs/nfs/nfs_var.h Thu Apr 29 23:48:09 2010 (r207406) @@ -371,7 +371,7 @@ int nfsrpc_readlink(vnode_t, struct uio int nfsrpc_read(vnode_t, struct uio *, struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *); int nfsrpc_write(vnode_t, struct uio *, int *, u_char *, - struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *); + struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *, int); int nfsrpc_mknod(vnode_t, char *, int, struct vattr *, u_int32_t, enum vtype, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *, void *); @@ -504,7 +504,7 @@ int nfscl_maperr(NFSPROC_T *, int, uid_t void nfscl_init(void); /* nfs_clbio.c */ -int ncl_flush(vnode_t, int, struct ucred *, NFSPROC_T *, int); +int ncl_flush(vnode_t, int, struct ucred *, NFSPROC_T *, int, int); /* nfs_clnode.c */ void ncl_invalcaches(vnode_t); Modified: stable/8/sys/fs/nfsclient/nfs.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfs.h Thu Apr 29 23:22:38 2010 (r207405) +++ stable/8/sys/fs/nfsclient/nfs.h Thu Apr 29 23:48:09 2010 (r207406) @@ -79,14 +79,16 @@ int ncl_biowrite(struct vnode *, struct int ncl_vinvalbuf(struct vnode *, int, struct thread *, int); int ncl_asyncio(struct nfsmount *, struct buf *, struct ucred *, struct thread *); -int ncl_doio(struct vnode *, struct buf *, struct ucred *, struct thread *); +int ncl_doio(struct vnode *, struct buf *, struct ucred *, struct thread *, + int); void ncl_nhinit(void); void ncl_nhuninit(void); void ncl_nodelock(struct nfsnode *); void ncl_nodeunlock(struct nfsnode *); int ncl_getattrcache(struct vnode *, struct vattr *); int ncl_readrpc(struct vnode *, struct uio *, struct ucred *); -int ncl_writerpc(struct vnode *, struct uio *, struct ucred *, int *, int *); +int ncl_writerpc(struct vnode *, struct uio *, struct ucred *, int *, int *, + int); int ncl_readlinkrpc(struct vnode *, struct uio *, struct ucred *); int ncl_readdirrpc(struct vnode *, struct uio *, struct ucred *, struct thread *); Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clbio.c Thu Apr 29 23:22:38 2010 (r207405) +++ stable/8/sys/fs/nfsclient/nfs_clbio.c Thu Apr 29 23:48:09 2010 (r207406) @@ -336,7 +336,7 @@ ncl_putpages(struct vop_putpages_args *a else iomode = NFSWRITE_FILESYNC; - error = ncl_writerpc(vp, &uio, cred, &iomode, &must_commit); + error = ncl_writerpc(vp, &uio, cred, &iomode, &must_commit, 0); pmap_qremove(kva, npages); relpbuf(bp, &ncl_pbuf_freecnt); @@ -554,7 +554,7 @@ ncl_bioread(struct vnode *vp, struct uio if ((bp->b_flags & B_CACHE) == 0) { bp->b_iocmd = BIO_READ; vfs_busy_pages(bp, 0); - error = ncl_doio(vp, bp, cred, td); + error = ncl_doio(vp, bp, cred, td, 0); if (error) { brelse(bp); return (error); @@ -583,7 +583,7 @@ ncl_bioread(struct vnode *vp, struct uio if ((bp->b_flags & B_CACHE) == 0) { bp->b_iocmd = BIO_READ; vfs_busy_pages(bp, 0); - error = ncl_doio(vp, bp, cred, td); + error = ncl_doio(vp, bp, cred, td, 0); if (error) { bp->b_ioflags |= BIO_ERROR; brelse(bp); @@ -609,7 +609,7 @@ ncl_bioread(struct vnode *vp, struct uio if ((bp->b_flags & B_CACHE) == 0) { bp->b_iocmd = BIO_READ; vfs_busy_pages(bp, 0); - error = ncl_doio(vp, bp, cred, td); + error = ncl_doio(vp, bp, cred, td, 0); if (error) { brelse(bp); } @@ -638,7 +638,7 @@ ncl_bioread(struct vnode *vp, struct uio if ((bp->b_flags & B_CACHE) == 0) { bp->b_iocmd = BIO_READ; vfs_busy_pages(bp, 0); - error = ncl_doio(vp, bp, cred, td); + error = ncl_doio(vp, bp, cred, td, 0); /* * no error + B_INVAL == directory EOF, * use the block. @@ -771,7 +771,7 @@ do_sync: uio.uio_td = td; iomode = NFSWRITE_FILESYNC; error = ncl_writerpc(vp, &uio, cred, &iomode, - &must_commit); + &must_commit, 0); KASSERT((must_commit == 0), ("ncl_directio_write: Did not commit write")); if (error) @@ -1122,7 +1122,7 @@ again: if ((bp->b_flags & B_CACHE) == 0) { bp->b_iocmd = BIO_READ; vfs_busy_pages(bp, 0); - error = ncl_doio(vp, bp, cred, td); + error = ncl_doio(vp, bp, cred, td, 0); if (error) { brelse(bp); break; @@ -1523,7 +1523,7 @@ ncl_doio_directwrite(struct buf *bp) iomode = NFSWRITE_FILESYNC; uiop->uio_td = NULL; /* NULL since we're in nfsiod */ - ncl_writerpc(bp->b_vp, uiop, bp->b_wcred, &iomode, &must_commit); + ncl_writerpc(bp->b_vp, uiop, bp->b_wcred, &iomode, &must_commit, 0); KASSERT((must_commit == 0), ("ncl_doio_directwrite: Did not commit write")); free(iov_base, M_NFSDIRECTIO); free(uiop->uio_iov, M_NFSDIRECTIO); @@ -1550,7 +1550,8 @@ ncl_doio_directwrite(struct buf *bp) * synchronously or from an nfsiod. */ int -ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td) +ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td, + int called_from_strategy) { struct uio *uiop; struct nfsnode *np; @@ -1695,7 +1696,8 @@ ncl_doio(struct vnode *vp, struct buf *b else iomode = NFSWRITE_FILESYNC; - error = ncl_writerpc(vp, uiop, cr, &iomode, &must_commit); + error = ncl_writerpc(vp, uiop, cr, &iomode, &must_commit, + called_from_strategy); /* * When setting B_NEEDCOMMIT also set B_CLUSTEROK to try @@ -1732,6 +1734,12 @@ ncl_doio(struct vnode *vp, struct buf *b * the block is reused. This is indicated by setting * the B_DELWRI and B_NEEDCOMMIT flags. * + * EIO is returned by ncl_writerpc() to indicate a recoverable + * write error and is handled as above, except that + * B_EINTR isn't set. One cause of this is a stale stateid + * error for the RPC that indicates recovery is required, + * when called with called_from_strategy != 0. + * * If the buffer is marked B_PAGING, it does not reside on * the vp's paging queues so we cannot call bdirty(). The * bp in this case is not an NFS cache block so we should @@ -1760,7 +1768,8 @@ ncl_doio(struct vnode *vp, struct buf *b bdirty(bp); bp->b_flags &= ~B_DONE; } - if (error && (bp->b_flags & B_ASYNC) == 0) + if ((error == EINTR || error == ETIMEDOUT) && + (bp->b_flags & B_ASYNC) == 0) bp->b_flags |= B_EINTR; splx(s); } else { Modified: stable/8/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clnfsiod.c Thu Apr 29 23:22:38 2010 (r207405) +++ stable/8/sys/fs/nfsclient/nfs_clnfsiod.c Thu Apr 29 23:48:09 2010 (r207406) @@ -278,9 +278,11 @@ nfssvc_iod(void *instance) (void)ncl_doio_directwrite(bp); } else { if (bp->b_iocmd == BIO_READ) - (void) ncl_doio(bp->b_vp, bp, bp->b_rcred, NULL); + (void) ncl_doio(bp->b_vp, bp, bp->b_rcred, + NULL, 0); else - (void) ncl_doio(bp->b_vp, bp, bp->b_wcred, NULL); + (void) ncl_doio(bp->b_vp, bp, bp->b_wcred, + NULL, 0); } mtx_lock(&ncl_iod_mutex); /* Modified: stable/8/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clnode.c Thu Apr 29 23:22:38 2010 (r207405) +++ stable/8/sys/fs/nfsclient/nfs_clnode.c Thu Apr 29 23:48:09 2010 (r207406) @@ -199,7 +199,7 @@ ncl_inactive(struct vop_inactive_args *a * available for the writes. */ if (nfscl_mustflush(vp)) - (void) ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1); + (void) ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1, 0); (void) nfsrpc_close(vp, 1, ap->a_td); } Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clrpcops.c Thu Apr 29 23:22:38 2010 (r207405) +++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c Thu Apr 29 23:48:09 2010 (r207406) @@ -1353,11 +1353,16 @@ nfsmout: /* * nfs write operation + * When called_from_strategy != 0, it should return EIO for an error that + * indicates recovery is in progress, so that the buffer will be left + * dirty and be written back to the server later. If it loops around, + * the recovery thread could get stuck waiting for the buffer and recovery + * will then deadlock. */ APPLESTATIC int nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, u_char *verfp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, - void *stuff) + void *stuff, int called_from_strategy) { int error, expireret = 0, retrycnt, nostateid; u_int32_t clidrev = 0; @@ -1417,12 +1422,15 @@ nfscl_dumpstate(nmp, 1, 1, 0, 0); expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); } retrycnt++; - } while (error == NFSERR_GRACE || error == NFSERR_STALESTATEID || - error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || + } while (error == NFSERR_GRACE || error == NFSERR_DELAY || + ((error == NFSERR_STALESTATEID || + error == NFSERR_STALEDONTRECOVER) && called_from_strategy == 0) || (error == NFSERR_OLDSTATEID && retrycnt < 20) || ((error == NFSERR_EXPIRED || error == NFSERR_BADSTATEID) && expireret == 0 && clidrev != 0 && retrycnt < 4)); - if (error && retrycnt >= 4) + if (error != 0 && (retrycnt >= 4 || + ((error == NFSERR_STALESTATEID || + error == NFSERR_STALEDONTRECOVER) && called_from_strategy != 0))) error = EIO; if (NFSHASNFSV4(nmp) && p == NULL) NFSFREECRED(newcred); Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clstate.c Thu Apr 29 23:22:38 2010 (r207405) +++ stable/8/sys/fs/nfsclient/nfs_clstate.c Thu Apr 29 23:48:09 2010 (r207406) @@ -139,7 +139,7 @@ static void nfscl_freedeleg(struct nfscl static int nfscl_errmap(struct nfsrv_descript *); static void nfscl_cleanup_common(struct nfsclclient *, u_int8_t *); static int nfscl_recalldeleg(struct nfsclclient *, struct nfsmount *, - struct nfscldeleg *, vnode_t, struct ucred *, NFSPROC_T *); + struct nfscldeleg *, vnode_t, struct ucred *, NFSPROC_T *, int); static void nfscl_freeopenowner(struct nfsclowner *, int); static void nfscl_cleandeleg(struct nfscldeleg *); static int nfscl_trydelegreturn(struct nfscldeleg *, struct ucred *, @@ -2469,7 +2469,7 @@ tryagain: NFSUNLOCKCLSTATE(); newnfs_copycred(&dp->nfsdl_cred, cred); ret = nfscl_recalldeleg(clp, clp->nfsc_nmp, dp, - NULL, cred, p); + NULL, cred, p, 1); if (!ret) { nfscl_cleandeleg(dp); TAILQ_REMOVE(&clp->nfsc_deleg, dp, @@ -3309,7 +3309,8 @@ nfscl_lockt(vnode_t vp, struct nfsclclie */ static int nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp, - struct nfscldeleg *dp, vnode_t vp, struct ucred *cred, NFSPROC_T *p) + struct nfscldeleg *dp, vnode_t vp, struct ucred *cred, NFSPROC_T *p, + int called_from_renewthread) { struct nfsclowner *owp, *lowp, *nowp; struct nfsclopen *op, *lop; @@ -3343,6 +3344,7 @@ nfscl_recalldeleg(struct nfsclclient *cl * Ok, if it's a write delegation, flush data to the server, so * that close/open consistency is retained. */ + ret = 0; NFSLOCKNODE(np); if ((dp->nfsdl_flags & NFSCLDL_WRITE) && (np->n_flag & NMODIFIED)) { #ifdef APPLE @@ -3351,7 +3353,8 @@ nfscl_recalldeleg(struct nfsclclient *cl np->n_flag |= NDELEGRECALL; #endif NFSUNLOCKNODE(np); - (void) ncl_flush(vp, MNT_WAIT, cred, p, 1); + ret = ncl_flush(vp, MNT_WAIT, cred, p, 1, + called_from_renewthread); NFSLOCKNODE(np); #ifdef APPLE OSBitAndAtomic((int32_t)~(NMODIFIED | NDELEGRECALL), (UInt32 *)&np->n_flag); @@ -3360,6 +3363,16 @@ nfscl_recalldeleg(struct nfsclclient *cl #endif } NFSUNLOCKNODE(np); + if (ret == EIO && called_from_renewthread != 0) { + /* + * If the flush failed with EIO for the renew thread, + * return now, so that the dirty buffer will be flushed + * later. + */ + if (gotvp != 0) + vrele(vp); + return (ret); + } /* * Now, for each openowner with opens issued locally, move them @@ -3857,7 +3870,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T NFSUNLOCKCLSTATE(); cred = newnfs_getcred(); newnfs_copycred(&dp->nfsdl_cred, cred); - (void) nfscl_recalldeleg(clp, nmp, dp, vp, cred, p); + (void) nfscl_recalldeleg(clp, nmp, dp, vp, cred, p, 0); NFSFREECRED(cred); triedrecall = 1; NFSLOCKCLSTATE(); @@ -3955,7 +3968,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stat NFSUNLOCKCLSTATE(); cred = newnfs_getcred(); newnfs_copycred(&dp->nfsdl_cred, cred); - (void) nfscl_recalldeleg(clp, nmp, dp, fvp, cred, p); + (void) nfscl_recalldeleg(clp, nmp, dp, fvp, cred, p, 0); NFSFREECRED(cred); triedrecall = 1; NFSLOCKCLSTATE(); Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Thu Apr 29 23:22:38 2010 (r207405) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Thu Apr 29 23:48:09 2010 (r207406) @@ -681,13 +681,13 @@ nfs_close(struct vop_close_args *ap) * traditional vnode locking implemented for Vnode Ops. */ int cm = newnfs_commit_on_close ? 1 : 0; - error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm); + error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm, 0); /* np->n_flag &= ~NMODIFIED; */ } else if (NFS_ISV4(vp)) { if (nfscl_mustflush(vp)) { int cm = newnfs_commit_on_close ? 1 : 0; error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, - cm); + cm, 0); /* * as above w.r.t races when clearing * NMODIFIED. @@ -1317,7 +1317,7 @@ ncl_readrpc(struct vnode *vp, struct uio */ int ncl_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred, - int *iomode, int *must_commit) + int *iomode, int *must_commit, int called_from_strategy) { struct nfsvattr nfsva; int error = 0, attrflag, ret; @@ -1326,7 +1326,7 @@ ncl_writerpc(struct vnode *vp, struct ui *must_commit = 0; error = nfsrpc_write(vp, uiop, iomode, verf, cred, - uiop->uio_td, &nfsva, &attrflag, NULL); + uiop->uio_td, &nfsva, &attrflag, NULL, called_from_strategy); NFSLOCKMNT(nmp); if (!error && NFSHASWRITEVERF(nmp) && NFSBCMP(verf, nmp->nm_verf, NFSX_VERF)) { @@ -2473,7 +2473,7 @@ nfs_strategy(struct vop_strategy_args *a */ if ((bp->b_flags & B_ASYNC) == 0 || ncl_asyncio(VFSTONFS(ap->a_vp->v_mount), bp, NOCRED, curthread)) - (void)ncl_doio(ap->a_vp, bp, cr, curthread); + (void) ncl_doio(ap->a_vp, bp, cr, curthread, 1); return (0); } @@ -2484,17 +2484,20 @@ nfs_strategy(struct vop_strategy_args *a static int nfs_fsync(struct vop_fsync_args *ap) { - return (ncl_flush(ap->a_vp, ap->a_waitfor, NULL, ap->a_td, 1)); + return (ncl_flush(ap->a_vp, ap->a_waitfor, NULL, ap->a_td, 1, 0)); } /* * Flush all the blocks associated with a vnode. * Walk through the buffer pool and push any dirty pages * associated with the vnode. + * If the called_from_renewthread argument is TRUE, it has been called + * from the NFSv4 renew thread and, as such, cannot block indefinitely + * waiting for a buffer write to complete. */ int ncl_flush(struct vnode *vp, int waitfor, struct ucred *cred, struct thread *td, - int commit) + int commit, int called_from_renewthread) { struct nfsnode *np = VTONFS(vp); struct buf *bp; @@ -2513,6 +2516,8 @@ ncl_flush(struct vnode *vp, int waitfor, struct buf *bvec_on_stack[NFS_COMMITBVECSIZ]; int bvecsize = 0, bveccount; + if (called_from_renewthread != 0) + slptimeo = hz; if (nmp->nm_flag & NFSMNT_INT) slpflag = NFS_PCATCH; if (!commit) @@ -2708,6 +2713,14 @@ loop: error = 0; goto loop; } + if (called_from_renewthread != 0) { + /* + * Return EIO so the flush will be retried + * later. + */ + error = EIO; + goto done; + } if (newnfs_sigintr(nmp, td)) { error = EINTR; goto done; @@ -2747,6 +2760,14 @@ loop: error = bufobj_wwait(bo, slpflag, slptimeo); if (error) { BO_UNLOCK(bo); + if (called_from_renewthread != 0) { + /* + * Return EIO so that the flush will be + * retried later. + */ + error = EIO; + goto done; + } error = newnfs_sigintr(nmp, td); if (error) goto done; @@ -2838,7 +2859,7 @@ nfs_advlock(struct vop_advlock_args *ap) */ if (ap->a_op == F_UNLCK && nfscl_checkwritelocked(vp, ap->a_fl, cred, td)) - (void) ncl_flush(vp, MNT_WAIT, cred, td, 1); + (void) ncl_flush(vp, MNT_WAIT, cred, td, 1, 0); /* * Loop around doing the lock op, while a blocking lock From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 00:34:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AFF30106566B; Fri, 30 Apr 2010 00:34:00 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9E6848FC13; Fri, 30 Apr 2010 00:34: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 o3U0Y0Tk005609; Fri, 30 Apr 2010 00:34:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U0Y0Qp005606; Fri, 30 Apr 2010 00:34:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004300034.o3U0Y0Qp005606@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 30 Apr 2010 00:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207409 - head/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 00:34:00 -0000 Author: yongari Date: Fri Apr 30 00:34:00 2010 New Revision: 207409 URL: http://svn.freebsd.org/changeset/base/207409 Log: Both RX_GMF_LP_THR and RX_GMF_UP_THR must be 16 bits register. If it is 8bits register then RX FIFO size can't exceed 2KB which is not true for almost all Yukon II controller. Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Apr 30 00:30:29 2010 (r207408) +++ head/sys/dev/msk/if_msk.c Fri Apr 30 00:34:00 2010 (r207409) @@ -3822,9 +3822,9 @@ msk_init_locked(struct msk_if_softc *sc_ if ((sc_if->msk_flags & MSK_FLAG_RAMBUF) == 0) { /* Set Rx Pause threshould. */ - CSR_WRITE_1(sc, MR_ADDR(sc_if->msk_port, RX_GMF_LP_THR), + CSR_WRITE_2(sc, MR_ADDR(sc_if->msk_port, RX_GMF_LP_THR), MSK_ECU_LLPP); - CSR_WRITE_1(sc, MR_ADDR(sc_if->msk_port, RX_GMF_UP_THR), + CSR_WRITE_2(sc, MR_ADDR(sc_if->msk_port, RX_GMF_UP_THR), MSK_ECU_ULPP); /* Configure store-and-forward for Tx. */ msk_set_tx_stfwd(sc_if); Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Fri Apr 30 00:30:29 2010 (r207408) +++ head/sys/dev/msk/if_mskreg.h Fri Apr 30 00:34:00 2010 (r207409) @@ -621,8 +621,8 @@ #define RX_GMF_FL_MSK 0x0c4c /* 32 bit Rx GMAC FIFO Flush Mask */ #define RX_GMF_FL_THR 0x0c50 /* 32 bit Rx GMAC FIFO Flush Threshold */ #define RX_GMF_TR_THR 0x0c54 /* 32 bit Rx Truncation Threshold (Yukon-2) */ -#define RX_GMF_UP_THR 0x0c58 /* 8 bit Rx Upper Pause Thr (Yukon-EC_U) */ -#define RX_GMF_LP_THR 0x0c5a /* 8 bit Rx Lower Pause Thr (Yukon-EC_U) */ +#define RX_GMF_UP_THR 0x0c58 /* 16 bit Rx Upper Pause Thr (Yukon-EC_U) */ +#define RX_GMF_LP_THR 0x0c5a /* 16 bit Rx Lower Pause Thr (Yukon-EC_U) */ #define RX_GMF_VLAN 0x0c5c /* 32 bit Rx VLAN Type Register (Yukon-2) */ #define RX_GMF_WP 0x0c60 /* 32 bit Rx GMAC FIFO Write Pointer */ #define RX_GMF_WLEV 0x0c68 /* 32 bit Rx GMAC FIFO Write Level */ From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 00:46:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F638106564A; Fri, 30 Apr 2010 00:46:44 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 69FB78FC08; Fri, 30 Apr 2010 00: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 o3U0kiah008451; Fri, 30 Apr 2010 00:46:44 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U0khG1008413; Fri, 30 Apr 2010 00:46:43 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004300046.o3U0khG1008413@svn.freebsd.org> From: Kip Macy Date: Fri, 30 Apr 2010 00:46: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: r207410 - in head: . sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/dev/drm sys/i386/i386 sys/i386/include sys/i386/xen sys/ia64/ia64 sys/ia64/include sys/kern sys/mi... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 00:46:44 -0000 Author: kmacy Date: Fri Apr 30 00:46:43 2010 New Revision: 207410 URL: http://svn.freebsd.org/changeset/base/207410 Log: On Alan's advice, rather than do a wholesale conversion on a single architecture from page queue lock to a hashed array of page locks (based on a patch by Jeff Roberson), I've implemented page lock support in the MI code and have only moved vm_page's hold_count out from under page queue mutex to page lock. This changes pmap_extract_and_hold on all pmaps. Supported by: Bitgravity Inc. Discussed with: alc, jeffr, and kib Modified: head/UPDATING head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h head/sys/amd64/include/vmparam.h head/sys/arm/arm/pmap.c head/sys/arm/include/pmap.h head/sys/dev/drm/via_dmablit.c head/sys/i386/i386/pmap.c head/sys/i386/include/pmap.h head/sys/i386/xen/pmap.c head/sys/ia64/ia64/pmap.c head/sys/ia64/include/pmap.h head/sys/kern/kern_exec.c head/sys/kern/subr_witness.c head/sys/kern/sys_pipe.c head/sys/kern/sys_process.c head/sys/kern/uipc_cow.c head/sys/kern/vfs_bio.c head/sys/mips/include/pmap.h head/sys/mips/mips/pmap.c head/sys/net/bpf_zerocopy.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pmap.h head/sys/sparc64/include/pmap.h head/sys/sparc64/sparc64/pmap.c head/sys/sun4v/include/pmap.h head/sys/sun4v/sun4v/pmap.c head/sys/sys/param.h head/sys/vm/device_pager.c head/sys/vm/sg_pager.c head/sys/vm/swap_pager.c head/sys/vm/uma_core.c head/sys/vm/vm_contig.c head/sys/vm/vm_fault.c head/sys/vm/vm_glue.c head/sys/vm/vm_kern.c head/sys/vm/vm_mmap.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_param.h head/sys/vm/vnode_pager.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Apr 30 00:34:00 2010 (r207409) +++ head/UPDATING Fri Apr 30 00:46:43 2010 (r207410) @@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) + +20100429: + 'vm_page's are now hashed by physical address to an array of mutexes. + Currently this is only used to serialize access to hold_count. Over + time the page queue mutex will be peeled away. This changes the size + of pmap on every architecture. And requires all callers of vm_page_hold + and vm_page_unhold to be updated. + 20100402: WITH_CTF can now be specified in src.conf (not recommended, there are some problems with static executables), make.conf (would also Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/amd64/amd64/pmap.c Fri Apr 30 00:46:43 2010 (r207410) @@ -793,7 +793,6 @@ static u_long pmap_pdpe_demotions; SYSCTL_ULONG(_vm_pmap_pdpe, OID_AUTO, demotions, CTLFLAG_RD, &pmap_pdpe_demotions, 0, "1GB page demotions"); - /*************************************************** * Low level helper routines..... ***************************************************/ @@ -1200,15 +1199,20 @@ pmap_extract_and_hold(pmap_t pmap, vm_of { pd_entry_t pde, *pdep; pt_entry_t pte; + vm_paddr_t pa; vm_page_t m; + pa = 0; m = NULL; - vm_page_lock_queues(); PMAP_LOCK(pmap); +retry: pdep = pmap_pde(pmap, va); if (pdep != NULL && (pde = *pdep)) { if (pde & PG_PS) { if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) { + if (vm_page_pa_tryrelock(pmap, (pde & PG_PS_FRAME) | + (va & PDRMASK), &pa)) + goto retry; m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | (va & PDRMASK)); vm_page_hold(m); @@ -1217,12 +1221,14 @@ pmap_extract_and_hold(pmap_t pmap, vm_of pte = *pmap_pde_to_pte(pdep, va); if ((pte & PG_V) && ((pte & PG_RW) || (prot & VM_PROT_WRITE) == 0)) { + if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME, &pa)) + goto retry; m = PHYS_TO_VM_PAGE(pte & PG_FRAME); vm_page_hold(m); } } } - vm_page_unlock_queues(); + PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } @@ -3143,9 +3149,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * In the case that a page table page is not * resident, we are creating it here. */ - if (va < VM_MAXUSER_ADDRESS) { + if (va < VM_MAXUSER_ADDRESS) mpte = pmap_allocpte(pmap, va, M_WAITOK); - } pde = pmap_pde(pmap, va); if (pde != NULL && (*pde & PG_V) != 0) { @@ -3393,7 +3398,7 @@ pmap_enter_object(pmap_t pmap, vm_offset mpte); m = TAILQ_NEXT(m, listq); } - PMAP_UNLOCK(pmap); + PMAP_UNLOCK(pmap); } /* Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/amd64/include/pmap.h Fri Apr 30 00:46:43 2010 (r207410) @@ -245,6 +245,8 @@ struct pmap { pml4_entry_t *pm_pml4; /* KVA of level 4 page table */ TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ u_int pm_active; /* active on cpus */ + uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ + u_int pm_retries; /* spare u_int here due to padding */ struct pmap_statistics pm_stats; /* pmap statistics */ vm_page_t pm_root; /* spare page table pages */ Modified: head/sys/amd64/include/vmparam.h ============================================================================== --- head/sys/amd64/include/vmparam.h Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/amd64/include/vmparam.h Fri Apr 30 00:46:43 2010 (r207410) @@ -145,6 +145,10 @@ #define VM_LEVEL_0_ORDER 9 #endif +#ifdef SMP +#define PA_LOCK_COUNT 256 +#endif + /* * Virtual addresses of things. Derived from the page directory and * page table indexes from pmap.h for precision. Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/arm/arm/pmap.c Fri Apr 30 00:46:43 2010 (r207410) @@ -3740,13 +3740,14 @@ pmap_extract_and_hold(pmap_t pmap, vm_of struct l2_dtable *l2; pd_entry_t l1pd; pt_entry_t *ptep, pte; - vm_paddr_t pa; + vm_paddr_t pa, paddr; vm_page_t m = NULL; u_int l1idx; l1idx = L1_IDX(va); + paddr = 0; - vm_page_lock_queues(); PMAP_LOCK(pmap); +retry: l1pd = pmap->pm_l1->l1_kva[l1idx]; if (l1pte_section_p(l1pd)) { /* @@ -3758,6 +3759,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_of pa = (l1pd & L1_SUP_FRAME) | (va & L1_SUP_OFFSET); else pa = (l1pd & L1_S_FRAME) | (va & L1_S_OFFSET); + if (vm_page_pa_tryrelock(pmap, pa & PG_FRAME, &paddr)) + goto retry; if (l1pd & L1_S_PROT_W || (prot & VM_PROT_WRITE) == 0) { m = PHYS_TO_VM_PAGE(pa); vm_page_hold(m); @@ -3774,7 +3777,6 @@ pmap_extract_and_hold(pmap_t pmap, vm_of if (l2 == NULL || (ptep = l2->l2_bucket[L2_BUCKET(l1idx)].l2b_kva) == NULL) { PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); return (NULL); } @@ -3783,7 +3785,6 @@ pmap_extract_and_hold(pmap_t pmap, vm_of if (pte == 0) { PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); return (NULL); } if (pte & L2_S_PROT_W || (prot & VM_PROT_WRITE) == 0) { @@ -3796,13 +3797,15 @@ pmap_extract_and_hold(pmap_t pmap, vm_of pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); break; } + if (vm_page_pa_tryrelock(pmap, pa & PG_FRAME, &paddr)) + goto retry; m = PHYS_TO_VM_PAGE(pa); vm_page_hold(m); } } PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); + PA_UNLOCK_COND(paddr); return (m); } Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/arm/include/pmap.h Fri Apr 30 00:46:43 2010 (r207410) @@ -134,6 +134,8 @@ struct pmap { struct l1_ttable *pm_l1; struct l2_dtable *pm_l2[L2_SIZE]; pd_entry_t *pm_pdir; /* KVA of page directory */ + uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ + u_int pm_retries; int pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statictics */ TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ Modified: head/sys/dev/drm/via_dmablit.c ============================================================================== --- head/sys/dev/drm/via_dmablit.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/dev/drm/via_dmablit.c Fri Apr 30 00:46:43 2010 (r207410) @@ -248,10 +248,12 @@ via_lock_all_dma_pages(drm_via_sg_info_t (vm_offset_t)xfer->mem_addr + IDX_TO_OFF(i), VM_PROT_RW); if (m == NULL) break; + vm_page_lock(m); vm_page_lock_queues(); vm_page_wire(m); vm_page_unhold(m); vm_page_unlock_queues(); + vm_page_unlock(m); vsg->pages[i] = m; } vsg->state = dr_via_pages_locked; Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/i386/i386/pmap.c Fri Apr 30 00:46:43 2010 (r207410) @@ -1346,14 +1346,19 @@ pmap_extract_and_hold(pmap_t pmap, vm_of pd_entry_t pde; pt_entry_t pte; vm_page_t m; + vm_paddr_t pa; + pa = 0; m = NULL; - vm_page_lock_queues(); PMAP_LOCK(pmap); +retry: pde = *pmap_pde(pmap, va); if (pde != 0) { if (pde & PG_PS) { if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) { + if (vm_page_pa_tryrelock(pmap, (pde & PG_PS_FRAME) | + (va & PDRMASK), &pa)) + goto retry; m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | (va & PDRMASK)); vm_page_hold(m); @@ -1363,13 +1368,15 @@ pmap_extract_and_hold(pmap_t pmap, vm_of pte = *pmap_pte_quick(pmap, va); if (pte != 0 && ((pte & PG_RW) || (prot & VM_PROT_WRITE) == 0)) { + if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME, &pa)) + goto retry; m = PHYS_TO_VM_PAGE(pte & PG_FRAME); vm_page_hold(m); } sched_unpin(); } } - vm_page_unlock_queues(); + PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/i386/include/pmap.h Fri Apr 30 00:46:43 2010 (r207410) @@ -420,11 +420,14 @@ struct pmap { u_int pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statistics */ LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ + uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ + u_int pm_retries; #ifdef PAE pdpt_entry_t *pm_pdpt; /* KVA of page director pointer table */ #endif vm_page_t pm_root; /* spare page table pages */ + }; typedef struct pmap *pmap_t; Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/i386/xen/pmap.c Fri Apr 30 00:46:43 2010 (r207410) @@ -1219,14 +1219,19 @@ pmap_extract_and_hold(pmap_t pmap, vm_of pd_entry_t pde; pt_entry_t pte; vm_page_t m; + vm_paddr_t pa; + pa = 0; m = NULL; - vm_page_lock_queues(); PMAP_LOCK(pmap); +retry: pde = PT_GET(pmap_pde(pmap, va)); if (pde != 0) { if (pde & PG_PS) { if ((pde & PG_RW) || (prot & VM_PROT_WRITE) == 0) { + if (vm_page_pa_tryrelock(pmap, (pde & PG_PS_FRAME) | + (va & PDRMASK), &pa)) + goto retry; m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | (va & PDRMASK)); vm_page_hold(m); @@ -1238,13 +1243,15 @@ pmap_extract_and_hold(pmap_t pmap, vm_of PT_SET_MA(PADDR1, 0); if ((pte & PG_V) && ((pte & PG_RW) || (prot & VM_PROT_WRITE) == 0)) { + if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME, &pa)) + goto retry; m = PHYS_TO_VM_PAGE(pte & PG_FRAME); vm_page_hold(m); } sched_unpin(); } } - vm_page_unlock_queues(); + PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/ia64/ia64/pmap.c Fri Apr 30 00:46:43 2010 (r207410) @@ -1028,18 +1028,22 @@ pmap_extract_and_hold(pmap_t pmap, vm_of struct ia64_lpte *pte; pmap_t oldpmap; vm_page_t m; + vm_paddr_t pa; + pa = 0; m = NULL; - vm_page_lock_queues(); PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); +retry: pte = pmap_find_vhpt(va); if (pte != NULL && pmap_present(pte) && (pmap_prot(pte) & prot) == prot) { m = PHYS_TO_VM_PAGE(pmap_ppn(pte)); + if (vm_page_pa_tryrelock(pmap, pmap_ppn(pte), &pa)) + goto retry; vm_page_hold(m); } - vm_page_unlock_queues(); + PA_UNLOCK_COND(pa); pmap_switch(oldpmap); PMAP_UNLOCK(pmap); return (m); Modified: head/sys/ia64/include/pmap.h ============================================================================== --- head/sys/ia64/include/pmap.h Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/ia64/include/pmap.h Fri Apr 30 00:46:43 2010 (r207410) @@ -77,6 +77,8 @@ struct pmap { TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ u_int32_t pm_rid[5]; /* base RID for pmap */ struct pmap_statistics pm_stats; /* pmap statistics */ + uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ + u_int pm_retries; }; typedef struct pmap *pmap_t; Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/kern/kern_exec.c Fri Apr 30 00:46:43 2010 (r207410) @@ -957,9 +957,9 @@ exec_map_first_page(imgp) return (EIO); } } - vm_page_lock_queues(); + vm_page_lock(ma[0]); vm_page_hold(ma[0]); - vm_page_unlock_queues(); + vm_page_unlock(ma[0]); vm_page_wakeup(ma[0]); VM_OBJECT_UNLOCK(object); @@ -979,9 +979,9 @@ exec_unmap_first_page(imgp) m = sf_buf_page(imgp->firstpage); sf_buf_free(imgp->firstpage); imgp->firstpage = NULL; - vm_page_lock_queues(); + vm_page_lock(m); vm_page_unhold(m); - vm_page_unlock_queues(); + vm_page_unlock(m); } } Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/kern/subr_witness.c Fri Apr 30 00:46:43 2010 (r207410) @@ -597,6 +597,15 @@ static struct witness_order_list_entry o { "cdev", &lock_class_mtx_sleep }, { NULL, NULL }, /* + * VM + * + */ + { "vm object", &lock_class_mtx_sleep }, + { "page lock", &lock_class_mtx_sleep }, + { "vm page queue mutex", &lock_class_mtx_sleep }, + { "pmap", &lock_class_mtx_sleep }, + { NULL, NULL }, + /* * kqueue/VFS interaction */ { "kqueue", &lock_class_mtx_sleep }, Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/kern/sys_pipe.c Fri Apr 30 00:46:43 2010 (r207410) @@ -773,10 +773,12 @@ pipe_build_write_buffer(wpipe, uio) */ race: if (vm_fault_quick((caddr_t)addr, VM_PROT_READ) < 0) { - vm_page_lock_queues(); - for (j = 0; j < i; j++) + + for (j = 0; j < i; j++) { + vm_page_lock(wpipe->pipe_map.ms[j]); vm_page_unhold(wpipe->pipe_map.ms[j]); - vm_page_unlock_queues(); + vm_page_unlock(wpipe->pipe_map.ms[j]); + } return (EFAULT); } wpipe->pipe_map.ms[i] = pmap_extract_and_hold(pmap, addr, @@ -816,11 +818,11 @@ pipe_destroy_write_buffer(wpipe) int i; PIPE_LOCK_ASSERT(wpipe, MA_OWNED); - vm_page_lock_queues(); for (i = 0; i < wpipe->pipe_map.npages; i++) { + vm_page_lock(wpipe->pipe_map.ms[i]); vm_page_unhold(wpipe->pipe_map.ms[i]); + vm_page_unlock(wpipe->pipe_map.ms[i]); } - vm_page_unlock_queues(); wpipe->pipe_map.npages = 0; } Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/kern/sys_process.c Fri Apr 30 00:46:43 2010 (r207410) @@ -328,9 +328,9 @@ proc_rwmem(struct proc *p, struct uio *u /* * Hold the page in memory. */ - vm_page_lock_queues(); + vm_page_lock(m); vm_page_hold(m); - vm_page_unlock_queues(); + vm_page_unlock(m); /* * We're done with tmap now. @@ -349,9 +349,9 @@ proc_rwmem(struct proc *p, struct uio *u /* * Release the page. */ - vm_page_lock_queues(); + vm_page_lock(m); vm_page_unhold(m); - vm_page_unlock_queues(); + vm_page_unlock(m); } while (error == 0 && uio->uio_resid > 0); Modified: head/sys/kern/uipc_cow.c ============================================================================== --- head/sys/kern/uipc_cow.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/kern/uipc_cow.c Fri Apr 30 00:46:43 2010 (r207410) @@ -128,10 +128,12 @@ socow_setup(struct mbuf *m0, struct uio /* * set up COW */ + vm_page_lock(pp); vm_page_lock_queues(); if (vm_page_cowsetup(pp) != 0) { vm_page_unhold(pp); vm_page_unlock_queues(); + vm_page_unlock(pp); return (0); } @@ -141,7 +143,7 @@ socow_setup(struct mbuf *m0, struct uio vm_page_wire(pp); vm_page_unhold(pp); vm_page_unlock_queues(); - + vm_page_unlock(pp); /* * Allocate an sf buf */ Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/kern/vfs_bio.c Fri Apr 30 00:46:43 2010 (r207410) @@ -3860,12 +3860,12 @@ vmapbuf(struct buf *bp) retry: if (vm_fault_quick(addr >= bp->b_data ? addr : bp->b_data, prot) < 0) { - vm_page_lock_queues(); for (i = 0; i < pidx; ++i) { + vm_page_lock(bp->b_pages[i]); vm_page_unhold(bp->b_pages[i]); + vm_page_unlock(bp->b_pages[i]); bp->b_pages[i] = NULL; } - vm_page_unlock_queues(); return(-1); } m = pmap_extract_and_hold(pmap, (vm_offset_t)addr, prot); @@ -3896,11 +3896,12 @@ vunmapbuf(struct buf *bp) npages = bp->b_npages; pmap_qremove(trunc_page((vm_offset_t)bp->b_data), npages); - vm_page_lock_queues(); - for (pidx = 0; pidx < npages; pidx++) + for (pidx = 0; pidx < npages; pidx++) { + vm_page_lock(bp->b_pages[pidx]); vm_page_unhold(bp->b_pages[pidx]); - vm_page_unlock_queues(); - + vm_page_unlock(bp->b_pages[pidx]); + } + bp->b_data = bp->b_saveaddr; } Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/mips/include/pmap.h Fri Apr 30 00:46:43 2010 (r207410) @@ -88,6 +88,8 @@ struct pmap { pd_entry_t *pm_segtab; /* KVA of segment table */ TAILQ_HEAD(, pv_entry) pm_pvlist; /* list of mappings in * pmap */ + uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ + u_int pm_retries; int pm_active; /* active on cpus */ struct { u_int32_t asid:ASID_BITS; /* TLB address space tag */ Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/mips/mips/pmap.c Fri Apr 30 00:46:43 2010 (r207410) @@ -147,7 +147,6 @@ unsigned pmap_max_asid; /* max ASID sup #define PMAP_ASID_RESERVED 0 - vm_offset_t kernel_vm_end; static struct tlb tlbstash[MAXCPU][MIPS_MAX_TLB_ENTRIES]; @@ -710,18 +709,22 @@ pmap_extract_and_hold(pmap_t pmap, vm_of { pt_entry_t pte; vm_page_t m; + vm_paddr_t pa; m = NULL; - vm_page_lock_queues(); + pa = 0; PMAP_LOCK(pmap); - +retry: pte = *pmap_pte(pmap, va); if (pte != 0 && pmap_pte_v(&pte) && ((pte & PTE_RW) || (prot & VM_PROT_WRITE) == 0)) { + if (vm_page_pa_tryrelock(pmap, mips_tlbpfn_to_paddr(pte), &pa)) + goto retry; + m = PHYS_TO_VM_PAGE(mips_tlbpfn_to_paddr(pte)); vm_page_hold(m); } - vm_page_unlock_queues(); + PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/net/bpf_zerocopy.c ============================================================================== --- head/sys/net/bpf_zerocopy.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/net/bpf_zerocopy.c Fri Apr 30 00:46:43 2010 (r207410) @@ -168,10 +168,12 @@ zbuf_sfbuf_get(struct vm_map *map, vm_of VM_PROT_WRITE); if (pp == NULL) return (NULL); + vm_page_lock(pp); vm_page_lock_queues(); vm_page_wire(pp); vm_page_unhold(pp); vm_page_unlock_queues(); + vm_page_unlock(pp); sf = sf_buf_alloc(pp, SFB_NOWAIT); if (sf == NULL) { zbuf_page_free(pp); Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/powerpc/aim/mmu_oea.c Fri Apr 30 00:46:43 2010 (r207410) @@ -1241,18 +1241,22 @@ moea_extract_and_hold(mmu_t mmu, pmap_t { struct pvo_entry *pvo; vm_page_t m; - + vm_paddr_t pa; + m = NULL; - vm_page_lock_queues(); + pa = 0; PMAP_LOCK(pmap); +retry: pvo = moea_pvo_find_va(pmap, va & ~ADDR_POFF, NULL); if (pvo != NULL && (pvo->pvo_pte.pte.pte_hi & PTE_VALID) && ((pvo->pvo_pte.pte.pte_lo & PTE_PP) == PTE_RW || (prot & VM_PROT_WRITE) == 0)) { + if (vm_page_pa_tryrelock(pmap, pvo->pvo_pte.pte.pte_lo & PTE_RPGN, &pa)) + goto retry; m = PHYS_TO_VM_PAGE(pvo->pvo_pte.pte.pte_lo & PTE_RPGN); vm_page_hold(m); } - vm_page_unlock_queues(); + PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Apr 30 00:46:43 2010 (r207410) @@ -1374,18 +1374,23 @@ moea64_extract_and_hold(mmu_t mmu, pmap_ { struct pvo_entry *pvo; vm_page_t m; + vm_paddr_t pa; m = NULL; - vm_page_lock_queues(); + pa = 0; PMAP_LOCK(pmap); +retry: pvo = moea64_pvo_find_va(pmap, va & ~ADDR_POFF, NULL); if (pvo != NULL && (pvo->pvo_pte.lpte.pte_hi & LPTE_VALID) && ((pvo->pvo_pte.lpte.pte_lo & LPTE_PP) == LPTE_RW || (prot & VM_PROT_WRITE) == 0)) { + if (vm_page_pa_tryrelock(pmap, + pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN, &pa)) + goto retry; m = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); vm_page_hold(m); } - vm_page_unlock_queues(); + PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/powerpc/booke/pmap.c Fri Apr 30 00:46:43 2010 (r207410) @@ -2034,11 +2034,12 @@ mmu_booke_extract_and_hold(mmu_t mmu, pm pte_t *pte; vm_page_t m; uint32_t pte_wbit; - + vm_paddr_t pa; + m = NULL; - vm_page_lock_queues(); + pa = 0; PMAP_LOCK(pmap); - +retry: pte = pte_find(mmu, pmap, va); if ((pte != NULL) && PTE_ISVALID(pte)) { if (pmap == kernel_pmap) @@ -2047,12 +2048,14 @@ mmu_booke_extract_and_hold(mmu_t mmu, pm pte_wbit = PTE_UW; if ((pte->flags & pte_wbit) || ((prot & VM_PROT_WRITE) == 0)) { + if (vm_page_pa_tryrelock(pmap, PTE_PA(pte), &pa)) + goto retry; m = PHYS_TO_VM_PAGE(PTE_PA(pte)); vm_page_hold(m); } } - vm_page_unlock_queues(); + PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); } Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/powerpc/include/pmap.h Fri Apr 30 00:46:43 2010 (r207410) @@ -88,6 +88,8 @@ struct pmap { struct mtx pm_mtx; u_int pm_sr[16]; u_int pm_active; + uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ + u_int pm_retries; u_int pm_context; struct pmap *pmap_phys; Modified: head/sys/sparc64/include/pmap.h ============================================================================== --- head/sys/sparc64/include/pmap.h Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/sparc64/include/pmap.h Fri Apr 30 00:46:43 2010 (r207410) @@ -62,6 +62,8 @@ struct pmap { struct tte *pm_tsb; vm_object_t pm_tsb_obj; u_int pm_active; + uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ + u_int pm_retries; u_int pm_context[MAXCPU]; struct pmap_statistics pm_stats; }; Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/sparc64/sparc64/pmap.c Fri Apr 30 00:46:43 2010 (r207410) @@ -694,13 +694,17 @@ pmap_extract_and_hold(pmap_t pm, vm_offs { struct tte *tp; vm_page_t m; + vm_paddr_t pa; m = NULL; - vm_page_lock_queues(); + pa = 0; + PMAP_LOCK(pm); +retry: if (pm == kernel_pmap) { if (va >= VM_MIN_DIRECT_ADDRESS) { tp = NULL; m = PHYS_TO_VM_PAGE(TLB_DIRECT_TO_PHYS(va)); + (void)vm_page_pa_tryrelock(pm, TLB_DIRECT_TO_PHYS(va), &pa); vm_page_hold(m); } else { tp = tsb_kvtotte(va); @@ -708,17 +712,17 @@ pmap_extract_and_hold(pmap_t pm, vm_offs tp = NULL; } } else { - PMAP_LOCK(pm); tp = tsb_tte_lookup(pm, va); } if (tp != NULL && ((tp->tte_data & TD_SW) || (prot & VM_PROT_WRITE) == 0)) { + if (vm_page_pa_tryrelock(pm, TTE_GET_PA(tp), &pa)) + goto retry; m = PHYS_TO_VM_PAGE(TTE_GET_PA(tp)); vm_page_hold(m); } - vm_page_unlock_queues(); - if (pm != kernel_pmap) - PMAP_UNLOCK(pm); + PA_UNLOCK_COND(pa); + PMAP_UNLOCK(pm); return (m); } Modified: head/sys/sun4v/include/pmap.h ============================================================================== --- head/sys/sun4v/include/pmap.h Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/sun4v/include/pmap.h Fri Apr 30 00:46:43 2010 (r207410) @@ -75,6 +75,8 @@ struct pmap { struct tte_hash *pm_hash; TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ struct hv_tsb_info pm_tsb; + uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ + u_int pm_retries; pmap_cpumask_t pm_active; /* mask of cpus currently using pmap */ pmap_cpumask_t pm_tlbactive; /* mask of cpus that have used this pmap */ struct pmap_statistics pm_stats; Modified: head/sys/sun4v/sun4v/pmap.c ============================================================================== --- head/sys/sun4v/sun4v/pmap.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/sun4v/sun4v/pmap.c Fri Apr 30 00:46:43 2010 (r207410) @@ -1275,17 +1275,21 @@ pmap_extract_and_hold(pmap_t pmap, vm_of { tte_t tte_data; vm_page_t m; + vm_paddr_t pa; m = NULL; - vm_page_lock_queues(); + pa = 0; PMAP_LOCK(pmap); +retry: tte_data = tte_hash_lookup(pmap->pm_hash, va); if (tte_data != 0 && ((tte_data & VTD_SW_W) || (prot & VM_PROT_WRITE) == 0)) { + if (vm_page_pa_tryrelock(pmap, TTE_GET_PA(tte_data), &pa)) + goto retry; m = PHYS_TO_VM_PAGE(TTE_GET_PA(tte_data)); vm_page_hold(m); } - vm_page_unlock_queues(); + PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); return (m); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/sys/param.h Fri Apr 30 00:46:43 2010 (r207410) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900010 /* Master, propagated to newvers */ +#define __FreeBSD_version 900011 /* Master, propagated to newvers */ #ifndef LOCORE #include Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/vm/device_pager.c Fri Apr 30 00:46:43 2010 (r207410) @@ -251,12 +251,16 @@ dev_pager_getpages(object, m, count, req VM_OBJECT_LOCK(object); dev_pager_updatefake(page, paddr, memattr); if (count > 1) { - vm_page_lock_queues(); + for (i = 0; i < count; i++) { - if (i != reqpage) + if (i != reqpage) { + vm_page_lock(m[i]); + vm_page_lock_queues(); vm_page_free(m[i]); + vm_page_unlock_queues(); + vm_page_unlock(m[i]); + } } - vm_page_unlock_queues(); } } else { /* @@ -266,10 +270,13 @@ dev_pager_getpages(object, m, count, req page = dev_pager_getfake(paddr, memattr); VM_OBJECT_LOCK(object); TAILQ_INSERT_TAIL(&object->un_pager.devp.devp_pglist, page, pageq); - vm_page_lock_queues(); - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) { + vm_page_lock(m[i]); + vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); + vm_page_unlock_queues(); + vm_page_unlock(m[i]); + } vm_page_insert(page, object, offset); m[reqpage] = page; } Modified: head/sys/vm/sg_pager.c ============================================================================== --- head/sys/vm/sg_pager.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/vm/sg_pager.c Fri Apr 30 00:46:43 2010 (r207410) @@ -198,10 +198,13 @@ sg_pager_getpages(vm_object_t object, vm TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, pageq); /* Free the original pages and insert this fake page into the object. */ - vm_page_lock_queues(); - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) { + vm_page_lock(m[i]); + vm_page_lock_queues(); vm_page_free(m[i]); - vm_page_unlock_queues(); + vm_page_unlock_queues(); + vm_page_unlock(m[i]); + } vm_page_insert(page, object, offset); m[reqpage] = page; page->valid = VM_PAGE_BITS_ALL; Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/vm/swap_pager.c Fri Apr 30 00:46:43 2010 (r207410) @@ -1137,12 +1137,21 @@ swap_pager_getpages(vm_object_t object, if (0 < i || j < count) { int k; - vm_page_lock_queues(); - for (k = 0; k < i; ++k) + + for (k = 0; k < i; ++k) { + vm_page_lock(m[k]); + vm_page_lock_queues(); swp_pager_free_nrpage(m[k]); - for (k = j; k < count; ++k) + vm_page_unlock_queues(); + vm_page_unlock(m[k]); + } + for (k = j; k < count; ++k) { + vm_page_lock(m[k]); + vm_page_lock_queues(); swp_pager_free_nrpage(m[k]); - vm_page_unlock_queues(); + vm_page_unlock_queues(); + vm_page_unlock(m[k]); + } } /* @@ -1497,7 +1506,7 @@ swp_pager_async_iodone(struct buf *bp) object = bp->b_pages[0]->object; VM_OBJECT_LOCK(object); } - vm_page_lock_queues(); + /* * cleanup pages. If an error occurs writing to swap, we are in * very serious trouble. If it happens to be a disk error, though, @@ -1509,6 +1518,8 @@ swp_pager_async_iodone(struct buf *bp) for (i = 0; i < bp->b_npages; ++i) { vm_page_t m = bp->b_pages[i]; + vm_page_lock(m); + vm_page_lock_queues(); m->oflags &= ~VPO_SWAPINPROG; if (bp->b_ioflags & BIO_ERROR) { @@ -1605,8 +1616,9 @@ swp_pager_async_iodone(struct buf *bp) if (vm_page_count_severe()) vm_page_try_to_cache(m); } + vm_page_unlock_queues(); + vm_page_unlock(m); } - vm_page_unlock_queues(); /* * adjust pip. NOTE: the original parent may still have its own @@ -1702,10 +1714,12 @@ swp_pager_force_pagein(vm_object_t objec m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL|VM_ALLOC_RETRY); if (m->valid == VM_PAGE_BITS_ALL) { vm_object_pip_subtract(object, 1); + vm_page_lock(m); vm_page_lock_queues(); vm_page_activate(m); vm_page_dirty(m); vm_page_unlock_queues(); + vm_page_unlock(m); vm_page_wakeup(m); vm_pager_page_unswapped(m); return; @@ -1714,10 +1728,12 @@ swp_pager_force_pagein(vm_object_t objec if (swap_pager_getpages(object, &m, 1, 0) != VM_PAGER_OK) panic("swap_pager_force_pagein: read from swap failed");/*XXX*/ vm_object_pip_subtract(object, 1); + vm_page_lock(m); vm_page_lock_queues(); vm_page_dirty(m); vm_page_dontneed(m); vm_page_unlock_queues(); + vm_page_unlock(m); vm_page_wakeup(m); vm_pager_page_unswapped(m); } Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/vm/uma_core.c Fri Apr 30 00:46:43 2010 (r207410) @@ -1022,10 +1022,12 @@ obj_alloc(uma_zone_t zone, int bytes, u_ while (pages != startpages) { pages--; p = TAILQ_LAST(&object->memq, pglist); + vm_page_lock(p); vm_page_lock_queues(); vm_page_unwire(p, 0); vm_page_free(p); vm_page_unlock_queues(); + vm_page_unlock(p); } retkva = 0; goto done; Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/vm/vm_contig.c Fri Apr 30 00:46:43 2010 (r207410) @@ -257,9 +257,11 @@ retry: i -= PAGE_SIZE; m = vm_page_lookup(object, OFF_TO_IDX(offset + i)); + vm_page_lock(m); vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); + vm_page_unlock(m); } VM_OBJECT_UNLOCK(object); vm_map_delete(map, addr, addr + size); Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Apr 30 00:34:00 2010 (r207409) +++ head/sys/vm/vm_fault.c Fri Apr 30 00:46:43 2010 (r207410) @@ -137,9 +137,11 @@ release_page(struct faultstate *fs) { vm_page_wakeup(fs->m); + vm_page_lock(fs->m); vm_page_lock_queues(); vm_page_deactivate(fs->m); vm_page_unlock_queues(); + vm_page_unlock(fs->m); fs->m = NULL; } @@ -161,9 +163,11 @@ unlock_and_deallocate(struct faultstate VM_OBJECT_UNLOCK(fs->object); if (fs->object != fs->first_object) { VM_OBJECT_LOCK(fs->first_object); + vm_page_lock(fs->first_m); vm_page_lock_queues(); vm_page_free(fs->first_m); vm_page_unlock_queues(); + vm_page_unlock(fs->first_m); vm_object_pip_wakeup(fs->first_object); VM_OBJECT_UNLOCK(fs->first_object); fs->first_m = NULL; @@ -305,12 +309,14 @@ RetryFault:; * removes the page from the backing object, * which is not what we want. */ + vm_page_lock(fs.m); vm_page_lock_queues(); if ((fs.m->cow) && (fault_type & VM_PROT_WRITE) && (fs.object == fs.first_object)) { vm_page_cowfault(fs.m); vm_page_unlock_queues(); + vm_page_unlock(fs.m); unlock_and_deallocate(&fs); goto RetryFault; } @@ -333,12 +339,15 @@ RetryFault:; */ if ((fs.m->oflags & VPO_BUSY) || fs.m->busy) { vm_page_unlock_queues(); + vm_page_unlock(fs.m); VM_OBJECT_UNLOCK(fs.object); if (fs.object != fs.first_object) { VM_OBJECT_LOCK(fs.first_object); + vm_page_lock(fs.first_m); vm_page_lock_queues(); vm_page_free(fs.first_m); vm_page_unlock_queues(); + vm_page_unlock(fs.first_m); vm_object_pip_wakeup(fs.first_object); VM_OBJECT_UNLOCK(fs.first_object); fs.first_m = NULL; @@ -358,6 +367,7 @@ RetryFault:; } vm_pageq_remove(fs.m); vm_page_unlock_queues(); + vm_page_unlock(fs.m); /* * Mark page busy for other processes, and the @@ -481,17 +491,25 @@ readrest: continue; if (!are_queues_locked) { are_queues_locked = TRUE; + vm_page_lock(mt); + vm_page_lock_queues(); + } else { + vm_page_unlock_queues(); + vm_page_lock(mt); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 02:35:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46EBC106564A; Fri, 30 Apr 2010 02:35:47 +0000 (UTC) (envelope-from davidch@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 34F0A8FC13; Fri, 30 Apr 2010 02:35:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3U2Zl7G032333; Fri, 30 Apr 2010 02:35:47 GMT (envelope-from davidch@svn.freebsd.org) Received: (from davidch@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U2ZlMY032330; Fri, 30 Apr 2010 02:35:47 GMT (envelope-from davidch@svn.freebsd.org) Message-Id: <201004300235.o3U2ZlMY032330@svn.freebsd.org> From: David Christensen Date: Fri, 30 Apr 2010 02:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207411 - head/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 02:35:47 -0000 Author: davidch Date: Fri Apr 30 02:35:46 2010 New Revision: 207411 URL: http://svn.freebsd.org/changeset/base/207411 Log: - Enable flow control. - Print device details only when verbose boot is enabled. - Add debug output for shared memory access. - Add debug statistics (checksum offload & VLAN frame counters). - Modify TX path to update consumer index for each frame completed rather than updating the consumer index only once for a group of frames to improve small packet performance. - Print driver/firmware pulse messages only when verbose boot is enabled. - Add debug sysctl to clear statistics. - Fix more style(9) violations. MFC after: 2 weeks Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcereg.h Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Fri Apr 30 00:46:43 2010 (r207410) +++ head/sys/dev/bce/if_bce.c Fri Apr 30 02:35:46 2010 (r207411) @@ -303,7 +303,7 @@ static void bce_dump_txbd (struct bce_s static void bce_dump_rxbd (struct bce_softc *, int, struct rx_bd *); #ifdef BCE_JUMBO_HDRSPLIT -static void bce_dump_pgbd (struct bce_softc *, +static void bce_dump_pgbd (struct bce_softc *, int, struct rx_bd *); #endif static void bce_dump_l2fhdr (struct bce_softc *, @@ -368,7 +368,7 @@ static int bce_nvram_write (struct bce /****************************************************************************/ static void bce_get_media (struct bce_softc *); static void bce_init_media (struct bce_softc *); -static void bce_dma_map_addr (void *, +static void bce_dma_map_addr (void *, bus_dma_segment_t *, int, int); static int bce_dma_alloc (device_t); static void bce_dma_free (struct bce_softc *); @@ -379,7 +379,7 @@ static void bce_release_resources (struc /****************************************************************************/ static int bce_fw_sync (struct bce_softc *, u32); static void bce_load_rv2p_fw (struct bce_softc *, u32 *, u32, u32); -static void bce_load_cpu_fw (struct bce_softc *, +static void bce_load_cpu_fw (struct bce_softc *, struct cpu_reg *, struct fw_info *); static void bce_start_cpu (struct bce_softc *, struct cpu_reg *); static void bce_halt_cpu (struct bce_softc *, struct cpu_reg *); @@ -401,21 +401,21 @@ static int bce_blockinit (struct bce_ static int bce_init_tx_chain (struct bce_softc *); static void bce_free_tx_chain (struct bce_softc *); -static int bce_get_rx_buf (struct bce_softc *, +static int bce_get_rx_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *, u32 *); static int bce_init_rx_chain (struct bce_softc *); static void bce_fill_rx_chain (struct bce_softc *); static void bce_free_rx_chain (struct bce_softc *); #ifdef BCE_JUMBO_HDRSPLIT -static int bce_get_pg_buf (struct bce_softc *, +static int bce_get_pg_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *); static int bce_init_pg_chain (struct bce_softc *); static void bce_fill_pg_chain (struct bce_softc *); static void bce_free_pg_chain (struct bce_softc *); #endif -static struct mbuf *bce_tso_setup (struct bce_softc *, +static struct mbuf *bce_tso_setup (struct bce_softc *, struct mbuf **, u16 *); static int bce_tx_encap (struct bce_softc *, struct mbuf **); static void bce_start_locked (struct ifnet *); @@ -566,7 +566,7 @@ bce_probe(device_t dev) /* Print out the device identity. */ snprintf(descbuf, BCE_DEVDESC_MAX, "%s (%c%d)", - t->bce_name, (((pci_read_config(dev, + t->bce_name, (((pci_read_config(dev, PCIR_REVID, 4) & 0xf0) >> 4) + 'A'), (pci_read_config(dev, PCIR_REVID, 4) & 0xf)); @@ -593,57 +593,60 @@ bce_probe(device_t dev) static void bce_print_adapter_info(struct bce_softc *sc) { - int i = 0; + int i = 0; DBENTER(BCE_VERBOSE_LOAD); - BCE_PRINTF("ASIC (0x%08X); ", sc->bce_chipid); - printf("Rev (%c%d); ", ((BCE_CHIP_ID(sc) & 0xf000) >> 12) + 'A', - ((BCE_CHIP_ID(sc) & 0x0ff0) >> 4)); - - /* Bus info. */ - if (sc->bce_flags & BCE_PCIE_FLAG) { - printf("Bus (PCIe x%d, ", sc->link_width); - switch (sc->link_speed) { - case 1: printf("2.5Gbps); "); break; - case 2: printf("5Gbps); "); break; - default: printf("Unknown link speed); "); + if (bootverbose) { + BCE_PRINTF("ASIC (0x%08X); ", sc->bce_chipid); + printf("Rev (%c%d); ", ((BCE_CHIP_ID(sc) & 0xf000) >> + 12) + 'A', ((BCE_CHIP_ID(sc) & 0x0ff0) >> 4)); + + + /* Bus info. */ + if (sc->bce_flags & BCE_PCIE_FLAG) { + printf("Bus (PCIe x%d, ", sc->link_width); + switch (sc->link_speed) { + case 1: printf("2.5Gbps); "); break; + case 2: printf("5Gbps); "); break; + default: printf("Unknown link speed); "); + } + } else { + printf("Bus (PCI%s, %s, %dMHz); ", + ((sc->bce_flags & BCE_PCIX_FLAG) ? "-X" : ""), + ((sc->bce_flags & BCE_PCI_32BIT_FLAG) ? + "32-bit" : "64-bit"), sc->bus_speed_mhz); } - } else { - printf("Bus (PCI%s, %s, %dMHz); ", - ((sc->bce_flags & BCE_PCIX_FLAG) ? "-X" : ""), - ((sc->bce_flags & BCE_PCI_32BIT_FLAG) ? - "32-bit" : "64-bit"), sc->bus_speed_mhz); - } - /* Firmware version and device features. */ - printf("B/C (%s); Flags (", sc->bce_bc_ver); + /* Firmware version and device features. */ + printf("B/C (%s); Flags (", sc->bce_bc_ver); -#ifdef BCE_JUMBO_HDRSPLIT - printf("SPLT"); - i++; -#endif + #ifdef BCE_JUMBO_HDRSPLIT + printf("SPLT"); + i++; + #endif - if (sc->bce_flags & BCE_USING_MSI_FLAG) { - if (i > 0) printf("|"); - printf("MSI"); i++; - } + if (sc->bce_flags & BCE_USING_MSI_FLAG) { + if (i > 0) printf("|"); + printf("MSI"); i++; + } - if (sc->bce_flags & BCE_USING_MSIX_FLAG) { - if (i > 0) printf("|"); - printf("MSI-X"); i++; - } + if (sc->bce_flags & BCE_USING_MSIX_FLAG) { + if (i > 0) printf("|"); + printf("MSI-X"); i++; + } - if (sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) { - if (i > 0) printf("|"); - printf("2.5G"); i++; - } + if (sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) { + if (i > 0) printf("|"); + printf("2.5G"); i++; + } - if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { - if (i > 0) printf("|"); - printf("MFW); MFW (%s)\n", sc->bce_mfw_ver); - } else { - printf(")\n"); + if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { + if (i > 0) printf("|"); + printf("MFW); MFW (%s)\n", sc->bce_mfw_ver); + } else { + printf(")\n"); + } } DBEXIT(BCE_VERBOSE_LOAD); @@ -785,13 +788,13 @@ bce_attach(device_t dev) (bce_msi_enable >= 1) && (sc->bce_msi_count == 0)) { sc->bce_msi_count = 1; if ((error = pci_alloc_msi(dev, &sc->bce_msi_count)) != 0) { - BCE_PRINTF("%s(%d): MSI allocation failed! error = %d\n", - __FILE__, __LINE__, error); + BCE_PRINTF("%s(%d): MSI allocation failed! " + "error = %d\n", __FILE__, __LINE__, error); sc->bce_msi_count = 0; pci_release_msi(dev); } else { - DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI interrupt.\n", - __FUNCTION__); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI " + "interrupt.\n", __FUNCTION__); sc->bce_flags |= BCE_USING_MSI_FLAG; if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) @@ -848,10 +851,11 @@ bce_attach(device_t dev) case BCE_CHIP_ID_5709_B0: case BCE_CHIP_ID_5709_B1: case BCE_CHIP_ID_5709_B2: - BCE_PRINTF("%s(%d): Unsupported controller revision (%c%d)!\n", - __FILE__, __LINE__, - (((pci_read_config(dev, PCIR_REVID, 4) & 0xf0) >> 4) + 'A'), - (pci_read_config(dev, PCIR_REVID, 4) & 0xf)); + BCE_PRINTF("%s(%d): Unsupported controller " + "revision (%c%d)!\n", __FILE__, __LINE__, + (((pci_read_config(dev, PCIR_REVID, 4) & + 0xf0) >> 4) + 'A'), (pci_read_config(dev, + PCIR_REVID, 4) & 0xf)); rc = ENODEV; goto bce_attach_fail; } @@ -1072,19 +1076,19 @@ bce_attach(device_t dev) ifp = sc->bce_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { BCE_PRINTF("%s(%d): Interface allocation failed!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; } /* Initialize the ifnet interface. */ - ifp->if_softc = sc; + ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_ioctl = bce_ioctl; - ifp->if_start = bce_start; - ifp->if_init = bce_init; - ifp->if_mtu = ETHERMTU; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_ioctl = bce_ioctl; + ifp->if_start = bce_start; + ifp->if_init = bce_init; + ifp->if_mtu = ETHERMTU; if (bce_tso_enable) { ifp->if_hwassist = BCE_IF_HWASSIST | CSUM_TSO; @@ -1095,7 +1099,7 @@ bce_attach(device_t dev) ifp->if_capabilities = BCE_IF_CAPABILITIES; } - ifp->if_capenable = ifp->if_capabilities; + ifp->if_capenable = ifp->if_capabilities; /* * Assume standard mbuf sizes for buffer allocation. @@ -1105,16 +1109,17 @@ bce_attach(device_t dev) #ifdef BCE_JUMBO_HDRSPLIT sc->rx_bd_mbuf_alloc_size = MHLEN; /* Make sure offset is 16 byte aligned for hardware. */ - sc->rx_bd_mbuf_align_pad = roundup2((MSIZE - MHLEN), 16) - - (MSIZE - MHLEN); - sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - - sc->rx_bd_mbuf_align_pad; + sc->rx_bd_mbuf_align_pad = + roundup2((MSIZE - MHLEN), 16) - (MSIZE - MHLEN); + sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - + sc->rx_bd_mbuf_align_pad; sc->pg_bd_mbuf_alloc_size = MCLBYTES; #else sc->rx_bd_mbuf_alloc_size = MCLBYTES; - sc->rx_bd_mbuf_align_pad = roundup2(MCLBYTES, 16) - MCLBYTES; - sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - - sc->rx_bd_mbuf_align_pad; + sc->rx_bd_mbuf_align_pad = + roundup2(MCLBYTES, 16) - MCLBYTES; + sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - + sc->rx_bd_mbuf_align_pad; #endif ifp->if_snd.ifq_drv_maxlen = USABLE_TX_BD; @@ -1126,14 +1131,14 @@ bce_attach(device_t dev) else ifp->if_baudrate = IF_Mbps(1000); - /* Handle any special PHY initialization for SerDes PHYs. */ - bce_init_media(sc); + /* Handle any special PHY initialization for SerDes PHYs. */ + bce_init_media(sc); /* MII child bus by probing the PHY. */ if (mii_phy_probe(dev, &sc->bce_miibus, bce_ifmedia_upd, bce_ifmedia_sts)) { BCE_PRINTF("%s(%d): No PHY found on child MII bus!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; } @@ -1155,7 +1160,7 @@ bce_attach(device_t dev) if (rc) { BCE_PRINTF("%s(%d): Failed to setup IRQ!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); bce_detach(dev); goto bce_attach_exit; } @@ -1396,6 +1401,9 @@ bce_reg_wr_ind(struct bce_softc *sc, u32 static void bce_shmem_wr(struct bce_softc *sc, u32 offset, u32 val) { + DBPRINT(sc, BCE_VERBOSE_FIRMWARE, "%s(): Writing 0x%08X to " + "0x%08X\n", __FUNCTION__, val, offset); + bce_reg_wr_ind(sc, sc->bce_shmem_base + offset, val); } @@ -1411,7 +1419,12 @@ bce_shmem_wr(struct bce_softc *sc, u32 o static u32 bce_shmem_rd(struct bce_softc *sc, u32 offset) { - return (bce_reg_rd_ind(sc, sc->bce_shmem_base + offset)); + u32 val = bce_reg_rd_ind(sc, sc->bce_shmem_base + offset); + + DBPRINT(sc, BCE_VERBOSE_FIRMWARE, "%s(): Reading 0x%08X from " + "0x%08X\n", __FUNCTION__, val, offset); + + return val; } @@ -1430,9 +1443,9 @@ bce_ctx_rd(struct bce_softc *sc, u32 cid { u32 idx, offset, retry_cnt = 5, val; - DBRUNIF((cid_addr > MAX_CID_ADDR || ctx_offset & 0x3 || cid_addr & CTX_MASK), - BCE_PRINTF("%s(): Invalid CID address: 0x%08X.\n", - __FUNCTION__, cid_addr)); + DBRUNIF((cid_addr > MAX_CID_ADDR || ctx_offset & 0x3 || + cid_addr & CTX_MASK), BCE_PRINTF("%s(): Invalid CID " + "address: 0x%08X.\n", __FUNCTION__, cid_addr)); offset = ctx_offset + cid_addr; @@ -1450,8 +1463,8 @@ bce_ctx_rd(struct bce_softc *sc, u32 cid if (val & BCE_CTX_CTX_CTRL_READ_REQ) BCE_PRINTF("%s(%d); Unable to read CTX memory: " - "cid_addr = 0x%08X, offset = 0x%08X!\n", - __FILE__, __LINE__, cid_addr, ctx_offset); + "cid_addr = 0x%08X, offset = 0x%08X!\n", + __FILE__, __LINE__, cid_addr, ctx_offset); val = REG_RD(sc, BCE_CTX_CTX_DATA); } else { @@ -1487,7 +1500,7 @@ bce_ctx_wr(struct bce_softc *sc, u32 cid DBRUNIF((cid_addr > MAX_CID_ADDR || ctx_offset & 0x3 || cid_addr & CTX_MASK), BCE_PRINTF("%s(): Invalid CID address: 0x%08X.\n", - __FUNCTION__, cid_addr)); + __FUNCTION__, cid_addr)); if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { @@ -1504,8 +1517,8 @@ bce_ctx_wr(struct bce_softc *sc, u32 cid if (val & BCE_CTX_CTX_CTRL_WRITE_REQ) BCE_PRINTF("%s(%d); Unable to write CTX memory: " - "cid_addr = 0x%08X, offset = 0x%08X!\n", - __FILE__, __LINE__, cid_addr, ctx_offset); + "cid_addr = 0x%08X, offset = 0x%08X!\n", + __FILE__, __LINE__, cid_addr, ctx_offset); } else { REG_WR(sc, BCE_CTX_DATA_ADR, offset); @@ -1706,54 +1719,73 @@ bce_miibus_statchg(device_t dev) val = REG_RD(sc, BCE_EMAC_MODE); val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX | - BCE_EMAC_MODE_MAC_LOOP | BCE_EMAC_MODE_FORCE_LINK | - BCE_EMAC_MODE_25G); + BCE_EMAC_MODE_MAC_LOOP | BCE_EMAC_MODE_FORCE_LINK | + BCE_EMAC_MODE_25G); - /* Set MII or GMII interface based on the speed negotiated by the PHY. */ + /* Set MII or GMII interface based on the PHY speed. */ switch (IFM_SUBTYPE(mii->mii_media_active)) { case IFM_10_T: if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { - DBPRINT(sc, BCE_INFO, "Enabling 10Mb interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, + "Enabling 10Mb interface.\n"); val |= BCE_EMAC_MODE_PORT_MII_10; break; } /* fall-through */ case IFM_100_TX: - DBPRINT(sc, BCE_INFO, "Enabling MII interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n"); val |= BCE_EMAC_MODE_PORT_MII; break; case IFM_2500_SX: - DBPRINT(sc, BCE_INFO, "Enabling 2.5G MAC mode.\n"); + DBPRINT(sc, BCE_INFO_PHY, "Enabling 2.5G MAC mode.\n"); val |= BCE_EMAC_MODE_25G; /* fall-through */ case IFM_1000_T: case IFM_1000_SX: - DBPRINT(sc, BCE_INFO, "Enabling GMII interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n"); val |= BCE_EMAC_MODE_PORT_GMII; break; default: - DBPRINT(sc, BCE_INFO, "Unknown speed, enabling default GMII " - "interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed, enabling " + "default GMII interface.\n"); val |= BCE_EMAC_MODE_PORT_GMII; } - /* Set half or full duplex based on the duplicity negotiated by the PHY. */ + /* Set half or full duplex based on PHY settings. */ if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) { - DBPRINT(sc, BCE_INFO, "Setting Half-Duplex interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, + "Setting Half-Duplex interface.\n"); val |= BCE_EMAC_MODE_HALF_DUPLEX; } else - DBPRINT(sc, BCE_INFO, "Setting Full-Duplex interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, + "Setting Full-Duplex interface.\n"); REG_WR(sc, BCE_EMAC_MODE, val); -#if 0 - /* ToDo: Enable flow control support in brgphy and bge. */ /* FLAG0 is set if RX is enabled and FLAG1 if TX is enabled */ - if (mii->mii_media_active & IFM_FLAG0) + if (mii->mii_media_active & IFM_FLAG0) { + DBPRINT(sc, BCE_INFO_PHY, + "%s(): Enabling RX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); - if (mii->mii_media_active & IFM_FLAG1) - BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); -#endif + } else { + DBPRINT(sc, BCE_INFO_PHY, + "%s(): Disabling RX flow control.\n", __FUNCTION__); + BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); + } + + if (mii->mii_media_active & IFM_FLAG1) { + DBPRINT(sc, BCE_INFO_PHY, + "%s(): Enabling TX flow control.\n", __FUNCTION__); + BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); + sc->bce_flags |= BCE_USING_TX_FLOW_CONTROL; + } else { + DBPRINT(sc, BCE_INFO_PHY, + "%s(): Disabling TX flow control.\n", __FUNCTION__); + BCE_CLRBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); + sc->bce_flags &= ~BCE_USING_TX_FLOW_CONTROL; + } + + /* ToDo: Update watermarks in bce_init_rx_context(). */ DBEXIT(BCE_VERBOSE_PHY); } @@ -1926,8 +1958,8 @@ bce_enable_nvram_access(struct bce_softc val = REG_RD(sc, BCE_NVM_ACCESS_ENABLE); /* Enable both bits, even on read. */ - REG_WR(sc, BCE_NVM_ACCESS_ENABLE, - val | BCE_NVM_ACCESS_ENABLE_EN | BCE_NVM_ACCESS_ENABLE_WR_EN); + REG_WR(sc, BCE_NVM_ACCESS_ENABLE, val | + BCE_NVM_ACCESS_ENABLE_EN | BCE_NVM_ACCESS_ENABLE_WR_EN); DBEXIT(BCE_VERBOSE_NVRAM); } @@ -1951,9 +1983,8 @@ bce_disable_nvram_access(struct bce_soft val = REG_RD(sc, BCE_NVM_ACCESS_ENABLE); /* Disable both bits, even after read. */ - REG_WR(sc, BCE_NVM_ACCESS_ENABLE, - val & ~(BCE_NVM_ACCESS_ENABLE_EN | - BCE_NVM_ACCESS_ENABLE_WR_EN)); + REG_WR(sc, BCE_NVM_ACCESS_ENABLE, val & + ~(BCE_NVM_ACCESS_ENABLE_EN | BCE_NVM_ACCESS_ENABLE_WR_EN)); DBEXIT(BCE_VERBOSE_NVRAM); } @@ -1983,7 +2014,7 @@ bce_nvram_erase_page(struct bce_softc *s /* Build an erase command. */ cmd = BCE_NVM_COMMAND_ERASE | BCE_NVM_COMMAND_WR | - BCE_NVM_COMMAND_DOIT; + BCE_NVM_COMMAND_DOIT; /* * Clear the DONE bit separately, set the NVRAM adress to erase, @@ -2026,8 +2057,8 @@ bce_nvram_erase_page_exit: /* 0 on success and the 32 bit value read, positive value on failure. */ /****************************************************************************/ static int -bce_nvram_read_dword(struct bce_softc *sc, u32 offset, u8 *ret_val, - u32 cmd_flags) +bce_nvram_read_dword(struct bce_softc *sc, + u32 offset, u8 *ret_val, u32 cmd_flags) { u32 cmd; int i, rc = 0; @@ -2040,8 +2071,8 @@ bce_nvram_read_dword(struct bce_softc *s /* Calculate the offset for buffered flash if translation is used. */ if (sc->bce_flash_info->flags & BCE_NV_TRANSLATE) { offset = ((offset / sc->bce_flash_info->page_size) << - sc->bce_flash_info->page_bits) + - (offset % sc->bce_flash_info->page_size); + sc->bce_flash_info->page_bits) + + (offset % sc->bce_flash_info->page_size); } /* @@ -2070,8 +2101,8 @@ bce_nvram_read_dword(struct bce_softc *s /* Check for errors. */ if (i >= NVRAM_TIMEOUT_COUNT) { - BCE_PRINTF("%s(%d): Timeout error reading NVRAM at offset 0x%08X!\n", - __FILE__, __LINE__, offset); + BCE_PRINTF("%s(%d): Timeout error reading NVRAM at " + "offset 0x%08X!\n", __FILE__, __LINE__, offset); rc = EBUSY; } @@ -2106,8 +2137,8 @@ bce_nvram_write_dword(struct bce_softc * /* Calculate the offset for buffered flash if translation is used. */ if (sc->bce_flash_info->flags & BCE_NV_TRANSLATE) { offset = ((offset / sc->bce_flash_info->page_size) << - sc->bce_flash_info->page_bits) + - (offset % sc->bce_flash_info->page_size); + sc->bce_flash_info->page_bits) + + (offset % sc->bce_flash_info->page_size); } /* @@ -2129,8 +2160,8 @@ bce_nvram_write_dword(struct bce_softc * break; } if (j >= NVRAM_TIMEOUT_COUNT) { - BCE_PRINTF("%s(%d): Timeout error writing NVRAM at offset 0x%08X\n", - __FILE__, __LINE__, offset); + BCE_PRINTF("%s(%d): Timeout error writing NVRAM at " + "offset 0x%08X\n", __FILE__, __LINE__, offset); rc = EBUSY; } @@ -2232,7 +2263,7 @@ bce_init_nvram(struct bce_softc *sc) if (j == entry_count) { sc->bce_flash_info = NULL; BCE_PRINTF("%s(%d): Unknown Flash NVRAM found!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENODEV; } @@ -2246,8 +2277,8 @@ bce_init_nvram_get_flash_size: sc->bce_flash_size = sc->bce_flash_info->total_size; DBPRINT(sc, BCE_INFO_LOAD, "%s(): Found %s, size = 0x%08X\n", - __FUNCTION__, sc->bce_flash_info->name, - sc->bce_flash_info->total_size); + __FUNCTION__, sc->bce_flash_info->name, + sc->bce_flash_info->total_size); DBEXIT(BCE_VERBOSE_NVRAM); return rc; @@ -2604,7 +2635,8 @@ bce_nvram_test(struct bce_softc *sc) * the magic value at offset 0. */ if ((rc = bce_nvram_read(sc, 0, data, 4)) != 0) { - BCE_PRINTF("%s(%d): Unable to read NVRAM!\n", __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Unable to read NVRAM!\n", + __FILE__, __LINE__); goto bce_nvram_test_exit; } @@ -2615,9 +2647,9 @@ bce_nvram_test(struct bce_softc *sc) magic = bce_be32toh(buf[0]); if (magic != BCE_NVRAM_MAGIC) { rc = ENODEV; - BCE_PRINTF("%s(%d): Invalid NVRAM magic value! Expected: 0x%08X, " - "Found: 0x%08X\n", - __FILE__, __LINE__, BCE_NVRAM_MAGIC, magic); + BCE_PRINTF("%s(%d): Invalid NVRAM magic value! " + "Expected: 0x%08X, Found: 0x%08X\n", + __FILE__, __LINE__, BCE_NVRAM_MAGIC, magic); goto bce_nvram_test_exit; } @@ -2626,26 +2658,27 @@ bce_nvram_test(struct bce_softc *sc) * configuration data. */ if ((rc = bce_nvram_read(sc, 0x100, data, BCE_NVRAM_SIZE)) != 0) { - BCE_PRINTF("%s(%d): Unable to read Manufacturing Information from " - "NVRAM!\n", __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Unable to read manufacturing " + "Information from NVRAM!\n", __FILE__, __LINE__); goto bce_nvram_test_exit; } csum = ether_crc32_le(data, 0x100); if (csum != BCE_CRC32_RESIDUAL) { rc = ENODEV; - BCE_PRINTF("%s(%d): Invalid Manufacturing Information NVRAM CRC! " - "Expected: 0x%08X, Found: 0x%08X\n", - __FILE__, __LINE__, BCE_CRC32_RESIDUAL, csum); + BCE_PRINTF("%s(%d): Invalid manufacturing information " + "NVRAM CRC! Expected: 0x%08X, Found: 0x%08X\n", + __FILE__, __LINE__, BCE_CRC32_RESIDUAL, csum); goto bce_nvram_test_exit; } csum = ether_crc32_le(data + 0x100, 0x100); if (csum != BCE_CRC32_RESIDUAL) { rc = ENODEV; - BCE_PRINTF("%s(%d): Invalid Feature Configuration Information " - "NVRAM CRC! Expected: 0x%08X, Found: 08%08X\n", - __FILE__, __LINE__, BCE_CRC32_RESIDUAL, csum); + BCE_PRINTF("%s(%d): Invalid feature configuration " + "information NVRAM CRC! Expected: 0x%08X, " + "Found: 08%08X\n", __FILE__, __LINE__, + BCE_CRC32_RESIDUAL, csum); } bce_nvram_test_exit: @@ -2666,7 +2699,7 @@ bce_get_media(struct bce_softc *sc) { u32 val; - DBENTER(BCE_VERBOSE); + DBENTER(BCE_VERBOSE_PHY); /* Assume PHY address for copper controllers. */ sc->bce_phy_addr = 1; @@ -2692,10 +2725,10 @@ bce_get_media(struct bce_softc *sc) } if (val & BCE_MISC_DUAL_MEDIA_CTRL_STRAP_OVERRIDE) - strap = (val & + strap = (val & BCE_MISC_DUAL_MEDIA_CTRL_PHY_CTRL) >> 21; else - strap = (val & + strap = (val & BCE_MISC_DUAL_MEDIA_CTRL_PHY_CTRL_STRAP) >> 8; if (pci_get_function(sc->bce_dev) == 0) { @@ -2744,7 +2777,7 @@ bce_get_media(struct bce_softc *sc) val = bce_shmem_rd(sc, BCE_SHARED_HW_CFG_CONFIG); if (val & BCE_SHARED_HW_CFG_PHY_2_5G) { - sc->bce_phy_flags |= + sc->bce_phy_flags |= BCE_PHY_2_5G_CAPABLE_FLAG; DBPRINT(sc, BCE_INFO_LOAD, "Found 2.5Gb " "capable adapter\n"); @@ -2758,7 +2791,7 @@ bce_get_media_exit: DBPRINT(sc, (BCE_INFO_LOAD | BCE_INFO_PHY), "Using PHY address %d.\n", sc->bce_phy_addr); - DBEXIT(BCE_VERBOSE); + DBEXIT(BCE_VERBOSE_PHY); } @@ -3056,7 +3089,9 @@ bce_dma_map_addr(void *arg, bus_dma_segm /* Simulate a mapping failure. */ DBRUNIF(DB_RANDOMTRUE(dma_map_addr_failed_sim_control), - error = ENOMEM); + error = ENOMEM); + + /* ToDo: How to increment debug sim_count variable here? */ /* Check for an error and signal the caller that an error occurred. */ if (error) { @@ -3154,7 +3189,7 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): status_block_paddr = 0x%jX\n", + DBPRINT(sc, BCE_INFO_LOAD, "%s(): status_block_paddr = 0x%jX\n", __FUNCTION__, (uintmax_t) sc->status_block_paddr); /* @@ -3193,7 +3228,7 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): stats_block_paddr = 0x%jX\n", + DBPRINT(sc, BCE_INFO_LOAD, "%s(): stats_block_paddr = 0x%jX\n", __FUNCTION__, (uintmax_t) sc->stats_block_paddr); /* BCM5709 uses host memory as cache for context memory. */ @@ -3217,8 +3252,8 @@ bce_dma_alloc(device_t dev) BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, BCM_PAGE_SIZE, 1, BCM_PAGE_SIZE, 0, NULL, NULL, &sc->ctx_tag)) { - BCE_PRINTF("%s(%d): Could not allocate CTX DMA tag!\n", - __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Could not allocate CTX " + "DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } @@ -3248,8 +3283,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): ctx_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->ctx_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): ctx_paddr[%d] " + "= 0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->ctx_paddr[i]); } } @@ -3262,15 +3298,15 @@ bce_dma_alloc(device_t dev) sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, BCE_TX_CHAIN_PAGE_SZ, 1, BCE_TX_CHAIN_PAGE_SZ, 0, NULL, NULL, &sc->tx_bd_chain_tag)) { - BCE_PRINTF("%s(%d): Could not allocate TX descriptor chain " - "DMA tag!\n", __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Could not allocate TX descriptor " + "chain DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } for (i = 0; i < TX_PAGES; i++) { - if(bus_dmamem_alloc(sc->tx_bd_chain_tag, + if(bus_dmamem_alloc(sc->tx_bd_chain_tag, (void **)&sc->tx_bd_chain[i], BUS_DMA_NOWAIT, &sc->tx_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate TX descriptor " @@ -3291,8 +3327,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): tx_bd_chain_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->tx_bd_chain_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): tx_bd_chain_paddr[%d] = " + "0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->tx_bd_chain_paddr[i]); } /* Check the required size before mapping to conserve resources. */ @@ -3368,8 +3405,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): rx_bd_chain_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->rx_bd_chain_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): rx_bd_chain_paddr[%d] = " + "0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->rx_bd_chain_paddr[i]); } /* @@ -3383,9 +3421,10 @@ bce_dma_alloc(device_t dev) #endif max_segments = 1; - DBPRINT(sc, BCE_INFO, "%s(): Creating rx_mbuf_tag (max size = 0x%jX " - "max segments = %d, max segment size = 0x%jX)\n", __FUNCTION__, - (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): Creating rx_mbuf_tag " + "(max size = 0x%jX max segments = %d, max segment " + "size = 0x%jX)\n", __FUNCTION__, (uintmax_t) max_size, + max_segments, (uintmax_t) max_seg_size); if (bus_dma_tag_create(sc->parent_tag, 1, BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, max_size, @@ -3429,7 +3468,7 @@ bce_dma_alloc(device_t dev) (void **)&sc->pg_bd_chain[i], BUS_DMA_NOWAIT, &sc->pg_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate page " - "descriptor chain DMA memory!\n", + "descriptor chain DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; @@ -3437,7 +3476,7 @@ bce_dma_alloc(device_t dev) bzero((char *)sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ); - error = bus_dmamap_load(sc->pg_bd_chain_tag, + error = bus_dmamap_load(sc->pg_bd_chain_tag, sc->pg_bd_chain_map[i], sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ, bce_dma_map_addr, &sc->pg_bd_chain_paddr[i], BUS_DMA_NOWAIT); @@ -3449,8 +3488,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): pg_bd_chain_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->pg_bd_chain_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): pg_bd_chain_paddr[%d] = " + "0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->pg_bd_chain_paddr[i]); } /* @@ -3524,7 +3564,7 @@ bce_release_resources(struct bce_softc * if (sc->bce_res_mem != NULL) { DBPRINT(sc, BCE_INFO_RESET, "Releasing PCI memory.\n"); - bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), + bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->bce_res_mem); } @@ -3582,7 +3622,7 @@ bce_fw_sync(struct bce_softc *sc, u32 ms DELAY(1000); } - /* If we've timed out, tell the bootcode that we've stopped waiting. */ + /* If we've timed out, tell bootcode that we've stopped waiting. */ if (((val & BCE_FW_MSG_ACK) != (msg_data & BCE_DRV_MSG_SEQ)) && ((msg_data & BCE_DRV_MSG_DATA) != BCE_DRV_MSG_DATA_WAIT0)) { @@ -4319,22 +4359,22 @@ bce_init_cpus(struct bce_softc *sc) (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { if ((BCE_CHIP_REV(sc) == BCE_CHIP_REV_Ax)) { - bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc1, - sizeof(bce_xi90_rv2p_proc1), RV2P_PROC1); - bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc2, - sizeof(bce_xi90_rv2p_proc2), RV2P_PROC2); + bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc1, + sizeof(bce_xi90_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc2, + sizeof(bce_xi90_rv2p_proc2), RV2P_PROC2); } else { - bce_load_rv2p_fw(sc, bce_xi_rv2p_proc1, - sizeof(bce_xi_rv2p_proc1), RV2P_PROC1); - bce_load_rv2p_fw(sc, bce_xi_rv2p_proc2, - sizeof(bce_xi_rv2p_proc2), RV2P_PROC2); + bce_load_rv2p_fw(sc, bce_xi_rv2p_proc1, + sizeof(bce_xi_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_xi_rv2p_proc2, + sizeof(bce_xi_rv2p_proc2), RV2P_PROC2); } } else { - bce_load_rv2p_fw(sc, bce_rv2p_proc1, - sizeof(bce_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_rv2p_proc1, + sizeof(bce_rv2p_proc1), RV2P_PROC1); bce_load_rv2p_fw(sc, bce_rv2p_proc2, - sizeof(bce_rv2p_proc2), RV2P_PROC2); + sizeof(bce_rv2p_proc2), RV2P_PROC2); } bce_init_rxp_cpu(sc); @@ -4373,7 +4413,7 @@ bce_init_ctx(struct bce_softc *sc) * in host memory so prepare the host memory * for access. */ - val = BCE_CTX_COMMAND_ENABLED | + val = BCE_CTX_COMMAND_ENABLED | BCE_CTX_COMMAND_MEM_INIT | (1 << 12); val |= (BCM_PAGE_BITS - 8) << 16; REG_WR(sc, BCE_CTX_COMMAND, val); @@ -4406,7 +4446,7 @@ bce_init_ctx(struct bce_softc *sc) /* Verify the context memory write was successful. */ for (j = 0; j < retry_cnt; j++) { val = REG_RD(sc, BCE_CTX_HOST_PAGE_TBL_CTRL); - if ((val & + if ((val & BCE_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ) == 0) break; DELAY(5); @@ -4461,6 +4501,7 @@ bce_get_mac_addr(struct bce_softc *sc) u32 mac_lo = 0, mac_hi = 0; DBENTER(BCE_VERBOSE_RESET); + /* * The NetXtreme II bootcode populates various NIC * power-on and runtime configuration items in a @@ -4475,7 +4516,7 @@ bce_get_mac_addr(struct bce_softc *sc) if ((mac_lo == 0) && (mac_hi == 0)) { BCE_PRINTF("%s(%d): Invalid Ethernet address!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); } else { sc->eaddr[0] = (u_char)(mac_hi >> 8); sc->eaddr[1] = (u_char)(mac_hi >> 0); @@ -4485,7 +4526,8 @@ bce_get_mac_addr(struct bce_softc *sc) sc->eaddr[5] = (u_char)(mac_lo >> 0); } - DBPRINT(sc, BCE_INFO_MISC, "Permanent Ethernet address = %6D\n", sc->eaddr, ":"); + DBPRINT(sc, BCE_INFO_MISC, "Permanent Ethernet " + "address = %6D\n", sc->eaddr, ":"); DBEXIT(BCE_VERBOSE_RESET); } @@ -4505,14 +4547,15 @@ bce_set_mac_addr(struct bce_softc *sc) /* ToDo: Add support for setting multiple MAC addresses. */ DBENTER(BCE_VERBOSE_RESET); - DBPRINT(sc, BCE_INFO_MISC, "Setting Ethernet address = %6D\n", sc->eaddr, ":"); + DBPRINT(sc, BCE_INFO_MISC, "Setting Ethernet address = " + "%6D\n", sc->eaddr, ":"); val = (mac_addr[0] << 8) | mac_addr[1]; REG_WR(sc, BCE_EMAC_MAC_MATCH0, val); val = (mac_addr[2] << 24) | (mac_addr[3] << 16) | - (mac_addr[4] << 8) | mac_addr[5]; + (mac_addr[4] << 8) | mac_addr[5]; REG_WR(sc, BCE_EMAC_MAC_MATCH1, val); @@ -4598,20 +4641,20 @@ bce_reset(struct bce_softc *sc, u32 rese DBENTER(BCE_VERBOSE_RESET); DBPRINT(sc, BCE_VERBOSE_RESET, "%s(): reset_code = 0x%08X\n", - __FUNCTION__, reset_code); + __FUNCTION__, reset_code); /* Wait for pending PCI transactions to complete. */ REG_WR(sc, BCE_MISC_ENABLE_CLR_BITS, - BCE_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE | - BCE_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE | - BCE_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE | - BCE_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE); + BCE_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE | + BCE_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE | + BCE_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE | + BCE_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE); val = REG_RD(sc, BCE_MISC_ENABLE_CLR_BITS); DELAY(5); /* Disable DMA */ if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || - (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { + (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { val = REG_RD(sc, BCE_MISC_NEW_CORE_CTL); val &= ~BCE_MISC_NEW_CORE_CTL_DMA_ENABLE; REG_WR(sc, BCE_MISC_NEW_CORE_CTL, val); @@ -4634,26 +4677,26 @@ bce_reset(struct bce_softc *sc, u32 rese /* Chip reset. */ if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || - (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { + (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { REG_WR(sc, BCE_MISC_COMMAND, BCE_MISC_COMMAND_SW_RESET); REG_RD(sc, BCE_MISC_COMMAND); DELAY(5); val = BCE_PCICFG_MISC_CONFIG_REG_WINDOW_ENA | - BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; + BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; pci_write_config(sc->bce_dev, BCE_PCICFG_MISC_CONFIG, val, 4); } else { val = BCE_PCICFG_MISC_CONFIG_CORE_RST_REQ | - BCE_PCICFG_MISC_CONFIG_REG_WINDOW_ENA | - BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; + BCE_PCICFG_MISC_CONFIG_REG_WINDOW_ENA | + BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; REG_WR(sc, BCE_PCICFG_MISC_CONFIG, val); /* Allow up to 30us for reset to complete. */ for (i = 0; i < 10; i++) { val = REG_RD(sc, BCE_PCICFG_MISC_CONFIG); if ((val & (BCE_PCICFG_MISC_CONFIG_CORE_RST_REQ | - BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) == 0) { + BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) == 0) { break; } DELAY(10); @@ -4661,9 +4704,9 @@ bce_reset(struct bce_softc *sc, u32 rese /* Check that reset completed successfully. */ if (val & (BCE_PCICFG_MISC_CONFIG_CORE_RST_REQ | - BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) { + BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) { BCE_PRINTF("%s(%d): Reset failed!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = EBUSY; goto bce_reset_exit; } @@ -4673,7 +4716,7 @@ bce_reset(struct bce_softc *sc, u32 rese val = REG_RD(sc, BCE_PCI_SWAP_DIAG0); if (val != 0x01020304) { BCE_PRINTF("%s(%d): Byte swap is incorrect!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENODEV; goto bce_reset_exit; } @@ -4685,8 +4728,8 @@ bce_reset(struct bce_softc *sc, u32 rese /* Wait for the firmware to finish its initialization. */ rc = bce_fw_sync(sc, BCE_DRV_MSG_DATA_WAIT1 | reset_code); if (rc) - BCE_PRINTF("%s(%d): Firmware did not complete initialization!\n", - __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Firmware did not complete " + "initialization!\n", __FILE__, __LINE__); bce_reset_exit: DBEXIT(BCE_VERBOSE_RESET); @@ -4709,13 +4752,13 @@ bce_chipinit(struct bce_softc *sc) * channels and PCI clock compensation delay. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 02:46:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CBB171065675; Fri, 30 Apr 2010 02:46:49 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id BB8038FC0A; Fri, 30 Apr 2010 02:46: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 o3U2knsc034864; Fri, 30 Apr 2010 02:46:49 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U2knNj034862; Fri, 30 Apr 2010 02:46:49 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004300246.o3U2knNj034862@svn.freebsd.org> From: Kip Macy Date: Fri, 30 Apr 2010 02:46: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: r207412 - 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, 30 Apr 2010 02:46:49 -0000 Author: kmacy Date: Fri Apr 30 02:46:49 2010 New Revision: 207412 URL: http://svn.freebsd.org/changeset/base/207412 Log: don't allow unsynchronized free in vm_page_unhold Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Apr 30 02:35:46 2010 (r207411) +++ head/sys/vm/vm_page.c Fri Apr 30 02:46:49 2010 (r207412) @@ -563,8 +563,11 @@ vm_page_unhold(vm_page_t mem) vm_page_lock_assert(mem, MA_OWNED); --mem->hold_count; KASSERT(mem->hold_count >= 0, ("vm_page_unhold: hold count < 0!!!")); - if (mem->hold_count == 0 && VM_PAGE_INQUEUE2(mem, PQ_HOLD)) + if (mem->hold_count == 0 && VM_PAGE_INQUEUE2(mem, PQ_HOLD)) { + vm_page_lock_queues(); vm_page_free_toq(mem); + vm_page_unlock_queues(); + } } /* From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 03:10:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF2E1106564A; Fri, 30 Apr 2010 03:10:53 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id CF0378FC15; Fri, 30 Apr 2010 03:10: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 o3U3Ar95040614; Fri, 30 Apr 2010 03:10:53 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U3Ar7l040612; Fri, 30 Apr 2010 03:10:53 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201004300310.o3U3Ar7l040612@svn.freebsd.org> From: Alfred Perlstein Date: Fri, 30 Apr 2010 03:10: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: r207415 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 03:10:54 -0000 Author: alfred Date: Fri Apr 30 03:10:53 2010 New Revision: 207415 URL: http://svn.freebsd.org/changeset/base/207415 Log: Do not set IO_NODELOCKED while writing to vnodes as our consumers do not lock the vnodes. Obtained from: Juniper Networks Reviewed by: jhb Modified: head/sys/kern/kern_gzio.c Modified: head/sys/kern/kern_gzio.c ============================================================================== --- head/sys/kern/kern_gzio.c Fri Apr 30 03:06:53 2010 (r207414) +++ head/sys/kern/kern_gzio.c Fri Apr 30 03:10:53 2010 (r207415) @@ -166,7 +166,7 @@ gzFile gz_open (path, mode, vp) 0 /*xflags*/, OS_CODE); if ((error = vn_rdwr(UIO_WRITE, s->file, buf, GZ_HEADER_LEN, s->outoff, - UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT, curproc->p_ucred, + UIO_SYSSPACE, IO_UNIT, curproc->p_ucred, NOCRED, &resid, curthread))) { s->outoff += GZ_HEADER_LEN - resid; return destroy(s), (gzFile)Z_NULL; @@ -234,7 +234,7 @@ int ZEXPORT gzwrite (file, buf, len) s->stream.next_out = s->outbuf; vfslocked = VFS_LOCK_GIANT(s->file->v_mount); error = vn_rdwr_inchunks(UIO_WRITE, s->file, s->outbuf, Z_BUFSIZE, - curoff, UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT, + curoff, UIO_SYSSPACE, IO_UNIT, curproc->p_ucred, NOCRED, &resid, curthread); VFS_UNLOCK_GIANT(vfslocked); if (error) { @@ -291,7 +291,7 @@ local int do_flush (file, flush) if (len != 0) { vfslocked = VFS_LOCK_GIANT(s->file->v_mount); error = vn_rdwr_inchunks(UIO_WRITE, s->file, s->outbuf, len, curoff, - UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT, curproc->p_ucred, + UIO_SYSSPACE, IO_UNIT, curproc->p_ucred, NOCRED, &resid, curthread); VFS_UNLOCK_GIANT(vfslocked); if (error) { @@ -350,7 +350,7 @@ local void putU32 (s, x) xx = x; #endif vn_rdwr(UIO_WRITE, s->file, (caddr_t)&xx, sizeof(xx), curoff, - UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT, curproc->p_ucred, + UIO_SYSSPACE, IO_UNIT, curproc->p_ucred, NOCRED, &resid, curthread); s->outoff += sizeof(xx) - resid; } From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 03:13:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A67B106566B; Fri, 30 Apr 2010 03:13:25 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0A8F28FC13; Fri, 30 Apr 2010 03:13: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 o3U3DOTB041214; Fri, 30 Apr 2010 03:13:24 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U3DOpj041212; Fri, 30 Apr 2010 03:13:24 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201004300313.o3U3DOpj041212@svn.freebsd.org> From: Alfred Perlstein Date: Fri, 30 Apr 2010 03:13: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: r207416 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 03:13:25 -0000 Author: alfred Date: Fri Apr 30 03:13:24 2010 New Revision: 207416 URL: http://svn.freebsd.org/changeset/base/207416 Log: Don't leak core_buf or gzfile if doing a compressed core file and we hit an error condition. Obtained from: Juniper Networks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Apr 30 03:10:53 2010 (r207415) +++ head/sys/kern/imgact_elf.c Fri Apr 30 03:13:24 2010 (r207416) @@ -1088,8 +1088,10 @@ __elfN(coredump)(struct thread *td, stru hdrsize = 0; __elfN(puthdr)(td, (void *)NULL, &hdrsize, seginfo.count); - if (hdrsize + seginfo.size >= limit) - return (EFAULT); + if (hdrsize + seginfo.size >= limit) { + error = EFAULT; + goto done; + } /* * Allocate memory for building the header, fill it up, @@ -1097,7 +1099,8 @@ __elfN(coredump)(struct thread *td, stru */ hdr = malloc(hdrsize, M_TEMP, M_WAITOK); if (hdr == NULL) { - return (EINVAL); + error = EINVAL; + goto done; } error = __elfN(corehdr)(td, vp, cred, seginfo.count, hdr, hdrsize, gzfile); @@ -1125,8 +1128,8 @@ __elfN(coredump)(struct thread *td, stru curproc->p_comm, error); } -#ifdef COMPRESS_USER_CORES done: +#ifdef COMPRESS_USER_CORES if (core_buf) free(core_buf, M_TEMP); if (gzfile) From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 03:15:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C19491065672; Fri, 30 Apr 2010 03:15:00 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id B0F8B8FC19; Fri, 30 Apr 2010 03:15: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 o3U3F0RL041616; Fri, 30 Apr 2010 03:15:00 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U3F049041614; Fri, 30 Apr 2010 03:15:00 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201004300315.o3U3F049041614@svn.freebsd.org> From: Alfred Perlstein Date: Fri, 30 Apr 2010 03:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207418 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 03:15:00 -0000 Author: alfred Date: Fri Apr 30 03:15:00 2010 New Revision: 207418 URL: http://svn.freebsd.org/changeset/base/207418 Log: Avoid allocating MAXHOSTNAMELEN bytes on the stack in expand_name(), use the heap instead. Obtained from: Juniper Networks Reviewed by: jhb Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Fri Apr 30 03:14:47 2010 (r207417) +++ head/sys/kern/kern_sig.c Fri Apr 30 03:15:00 2010 (r207418) @@ -3004,8 +3004,9 @@ expand_name(const char *name, uid_t uid, char *temp; size_t i; int indexpos; - char hostname[MAXHOSTNAMELEN]; + char *hostname; + hostname = NULL; format = corefilename; temp = malloc(MAXPATHLEN, M_TEMP, M_NOWAIT | M_ZERO); if (temp == NULL) @@ -3021,8 +3022,21 @@ expand_name(const char *name, uid_t uid, sbuf_putc(&sb, '%'); break; case 'H': /* hostname */ + if (hostname == NULL) { + hostname = malloc(MAXHOSTNAMELEN, + M_TEMP, M_NOWAIT); + if (hostname == NULL) { + log(LOG_ERR, + "pid %ld (%s), uid (%lu): " + "unable to alloc memory " + "for corefile hostname\n", + (long)pid, name, + (u_long)uid); + goto nomem; + } + } getcredhostname(td->td_ucred, hostname, - sizeof(hostname)); + MAXHOSTNAMELEN); sbuf_printf(&sb, "%s", hostname); break; case 'I': /* autoincrementing index */ @@ -3048,15 +3062,17 @@ expand_name(const char *name, uid_t uid, sbuf_putc(&sb, format[i]); } } + free(hostname, M_TEMP); #ifdef COMPRESS_USER_CORES if (compress) { sbuf_printf(&sb, GZ_SUFFIX); } #endif if (sbuf_overflowed(&sb)) { - sbuf_delete(&sb); log(LOG_ERR, "pid %ld (%s), uid (%lu): corename is too " "long\n", (long)pid, name, (u_long)uid); +nomem: + sbuf_delete(&sb); free(temp, M_TEMP); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 03:26:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CE66106566C; Fri, 30 Apr 2010 03:26:12 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4D28F8FC0C; Fri, 30 Apr 2010 03:26: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 o3U3QCu5044116; Fri, 30 Apr 2010 03:26:12 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U3QCpY044113; Fri, 30 Apr 2010 03:26:12 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004300326.o3U3QCpY044113@svn.freebsd.org> From: Kip Macy Date: Fri, 30 Apr 2010 03:26: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: r207419 - head/sys/i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 03:26:12 -0000 Author: kmacy Date: Fri Apr 30 03:26:12 2010 New Revision: 207419 URL: http://svn.freebsd.org/changeset/base/207419 Log: merge 194209 in to the i386/xen pmap requested by: alc@ Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Fri Apr 30 03:15:00 2010 (r207418) +++ head/sys/i386/xen/pmap.c Fri Apr 30 03:26:12 2010 (r207419) @@ -289,6 +289,12 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_ "Max number of PV entries"); SYSCTL_INT(_vm_pmap, OID_AUTO, shpgperproc, CTLFLAG_RD, &shpgperproc, 0, "Page share factor per proc"); +SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, + "2/4MB page mapping counters"); + +static u_long pmap_pde_mappings; +SYSCTL_ULONG(_vm_pmap_pde, OID_AUTO, mappings, CTLFLAG_RD, + &pmap_pde_mappings, 0, "2/4MB page mappings"); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t locked_pmap, int try); @@ -3130,64 +3136,59 @@ pmap_object_init_pt(pmap_t pmap, vm_offs vm_object_t object, vm_pindex_t pindex, vm_size_t size) { + pd_entry_t *pde; + vm_paddr_t pa, ptepa; vm_page_t p; + int pat_mode; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); if (pseflag && - ((addr & (NBPDR - 1)) == 0) && ((size & (NBPDR - 1)) == 0)) { - int i; - vm_page_t m[1]; - unsigned int ptepindex; - int npdes; - pd_entry_t ptepa; - - PMAP_LOCK(pmap); - if (pmap->pm_pdir[ptepindex = (addr >> PDRSHIFT)]) - goto out; - PMAP_UNLOCK(pmap); -retry: + (addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { + if (!vm_object_populate(object, pindex, pindex + atop(size))) + return; p = vm_page_lookup(object, pindex); - if (p != NULL) { - if (vm_page_sleep_if_busy(p, FALSE, "init4p")) - goto retry; - } else { - p = vm_page_alloc(object, pindex, VM_ALLOC_NORMAL); - if (p == NULL) - return; - m[0] = p; - - if (vm_pager_get_pages(object, m, 1, 0) != VM_PAGER_OK) { - vm_page_lock_queues(); - vm_page_free(p); - vm_page_unlock_queues(); - return; - } - - p = vm_page_lookup(object, pindex); - vm_page_wakeup(p); - } - + KASSERT(p->valid == VM_PAGE_BITS_ALL, + ("pmap_object_init_pt: invalid page %p", p)); + pat_mode = p->md.pat_mode; + /* + * Abort the mapping if the first page is not physically + * aligned to a 2/4MB page boundary. + */ ptepa = VM_PAGE_TO_PHYS(p); if (ptepa & (NBPDR - 1)) return; - - p->valid = VM_PAGE_BITS_ALL; - + /* + * Skip the first page. Abort the mapping if the rest of + * the pages are not physically contiguous or have differing + * memory attributes. + */ + p = TAILQ_NEXT(p, listq); + for (pa = ptepa + PAGE_SIZE; pa < ptepa + size; + pa += PAGE_SIZE) { + KASSERT(p->valid == VM_PAGE_BITS_ALL, + ("pmap_object_init_pt: invalid page %p", p)); + if (pa != VM_PAGE_TO_PHYS(p) || + pat_mode != p->md.pat_mode) + return; + p = TAILQ_NEXT(p, listq); + } + /* Map using 2/4MB pages. */ PMAP_LOCK(pmap); - pmap->pm_stats.resident_count += size >> PAGE_SHIFT; - npdes = size >> PDRSHIFT; - critical_enter(); - for(i = 0; i < npdes; i++) { - PD_SET_VA(pmap, ptepindex, - ptepa | PG_U | PG_M | PG_RW | PG_V | PG_PS, FALSE); - ptepa += NBPDR; - ptepindex += 1; + for (pa = ptepa | pmap_cache_bits(pat_mode, 1); pa < ptepa + + size; pa += NBPDR) { + pde = pmap_pde(pmap, addr); + if (*pde == 0) { + pde_store(pde, pa | PG_PS | PG_M | PG_A | + PG_U | PG_RW | PG_V); + pmap->pm_stats.resident_count += NBPDR / + PAGE_SIZE; + pmap_pde_mappings++; + } + /* Else continue on if the PDE is already valid. */ + addr += NBPDR; } - pmap_invalidate_all(pmap); - critical_exit(); -out: PMAP_UNLOCK(pmap); } } From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 03:28:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52AEB106566B; Fri, 30 Apr 2010 03:28:27 +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 16EFC8FC15; Fri, 30 Apr 2010 03:28:27 +0000 (UTC) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 6A8D52C2AEB; Thu, 29 Apr 2010 22:28:26 -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 FAtnqzm3ad27; Thu, 29 Apr 2010 22:28:18 -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 6ACBA2C2ACE; Thu, 29 Apr 2010 22:28:17 -0500 (CDT) Message-ID: <4BDA4E51.2020401@cs.rice.edu> Date: Thu, 29 Apr 2010 22:28:17 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100327) MIME-Version: 1.0 To: Kip Macy References: <201004300326.o3U3QCpY044113@svn.freebsd.org> In-Reply-To: <201004300326.o3U3QCpY044113@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207419 - head/sys/i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 03:28:27 -0000 Kip Macy wrote: > Author: kmacy > Date: Fri Apr 30 03:26:12 2010 > New Revision: 207419 > URL: http://svn.freebsd.org/changeset/base/207419 > > Log: > merge 194209 in to the i386/xen pmap > > requested by: alc@ > > Modified: > head/sys/i386/xen/pmap.c > Thanks. Alan From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 04:21:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCF58106566C; Fri, 30 Apr 2010 04:21:22 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id BDDBD8FC12; Fri, 30 Apr 2010 04: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 o3U4LMf0056222; Fri, 30 Apr 2010 04:21:22 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U4LMmV056220; Fri, 30 Apr 2010 04:21:22 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201004300421.o3U4LMmV056220@svn.freebsd.org> From: Jeff Roberson Date: Fri, 30 Apr 2010 04: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: r207421 - head/sbin/tunefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 04:21:22 -0000 Author: jeff Date: Fri Apr 30 04:21:22 2010 New Revision: 207421 URL: http://svn.freebsd.org/changeset/base/207421 Log: - Use the path to the filesystem mountpoint to look up the statfs structure so that we correctly reload. Note that tunefs doesn't properly detect the need to reload if the disk device is specified for a read-only mounted filesystem. - Lessen the contiguity requirement for the journal so that it is more likely to succeed. Modified: head/sbin/tunefs/tunefs.c Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Fri Apr 30 03:35:05 2010 (r207420) +++ head/sbin/tunefs/tunefs.c Fri Apr 30 04:21:22 2010 (r207421) @@ -280,9 +280,9 @@ main(int argc, char *argv[]) if (ufs_disk_fillout(&disk, special) == -1) goto err; if (disk.d_name != special) { - special = disk.d_name; - if (statfs(special, &stfs) == 0 && - strcmp(special, stfs.f_mntonname) == 0) + if (statfs(special, &stfs) != 0) + warn("Can't stat %s", special); + if (strcmp(special, stfs.f_mntonname) == 0) active = 1; } @@ -546,7 +546,7 @@ journal_balloc(void) * Try to minimize fragmentation by requiring a minimum * number of blocks present. */ - if (cgp->cg_cs.cs_nbfree > blocks / 8) + if (cgp->cg_cs.cs_nbfree > 128 * 1024 * 1024) break; if (contig == 0 && cgp->cg_cs.cs_nbfree) break; From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 07:01:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A45F01065670; Fri, 30 Apr 2010 07:01:32 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 61FB48FC14; Fri, 30 Apr 2010 07:01:32 +0000 (UTC) Received: by pxi17 with SMTP id 17so3969696pxi.13 for ; Fri, 30 Apr 2010 00:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FDMhZpdOv+h1kPLVagUF6F9iqXLm5q9mFTHsh6PXhRc=; b=ZqoxMy5j7XyNyrQMbjHS8FUfzspPFxZiVBhVfp4jLRSw1FfozI4wpwj3cCqqFr+Y+5 3Y8ObRMtEgb4w51Bcn+DZ8qxidHC2qNdcL8P6Wnq016ijQfGc/S9SO7D+SgTe/YDEFva FByM4Tk9Qay8q4IYTtEskTTonSfn3j7rUImyU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=OZNjMkmVyEITUB2fl56C3VFIGciQnMEW8Pjy9sXztes9DkXX9QLl1JCuzZseQGDQkA 8+Cxv/xs1E3jlAEXi4iHfMIcV7IwDoWQiu63uHqi19zE+stixEyp7Q3i2teW00Gn1BvI fw5Whwi8HuezxHuJcLnEVeY2G9/FwGGyPQynw= MIME-Version: 1.0 Received: by 10.140.55.10 with SMTP id d10mr486717rva.247.1272610884340; Fri, 30 Apr 2010 00:01:24 -0700 (PDT) Received: by 10.140.169.10 with HTTP; Fri, 30 Apr 2010 00:01:23 -0700 (PDT) In-Reply-To: References: <201004271750.o3RHoi8G078883@svn.freebsd.org> Date: Fri, 30 Apr 2010 00:01:23 -0700 Message-ID: From: Xin LI To: Ben Kaduk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r207283 - head/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 07:01:32 -0000 Hi, Ben, On Tue, Apr 27, 2010 at 10:55 AM, Ben Kaduk wrote: > On Tue, Apr 27, 2010 at 1:50 PM, Xin LI wrote: >> Author: delphij >> Date: Tue Apr 27 17:50:43 2010 >> New Revision: 207283 >> URL: http://svn.freebsd.org/changeset/base/207283 >> >> Log: >> =C2=A0Language improvements to make the BUGS section easier to read. >> >> =C2=A0Reviewed by: =C2=A0Alexander Best >> =C2=A0MFC after: =C2=A0 =C2=A013 days >> >> Modified: >> =C2=A0head/usr.bin/gzip/gzip.1 >> >> Modified: head/usr.bin/gzip/gzip.1 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/usr.bin/gzip/gzip.1 =C2=A0 =C2=A0Tue Apr 27 15:59:38 2010 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(r207282) >> +++ head/usr.bin/gzip/gzip.1 =C2=A0 =C2=A0Tue Apr 27 17:50:43 2010 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(r207283) >> @@ -218,8 +218,8 @@ with unpack support written by >> =C2=A0.An Xin LI Aq delphij@FreeBSD.org . >> =C2=A0.Sh BUGS >> =C2=A0According to RFC 1952, the recorded file size is stored in a 32-bi= t >> -integer and therefore it can not represent files that is bigger than >> -4GB in size. =C2=A0This limitation also applies to >> +integer, therefore, it can not represent files larger than 4GB. >> +This limitation also applies to > > Still not quite right -- the old version was wrong because it had > "files that is" instead of "files that are". =C2=A0The new version has a > comma splice, though -- the comma in "32-bit integer, therefore" > should be replaced with either a semicolon or a full stop. > > I would probably also put in two "the"s in the text following this > change -- "the -l option" and "the gzip utility". I would appreciate some native English speaking committers to help me on this, I personally have no much strong opinion on the wording :-/ >> =C2=A0.Fl l >> =C2=A0option of >> =C2=A0.Nm >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >> > --=20 Xin LI http://www.delphij.net From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 07:09:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86949106566B; Fri, 30 Apr 2010 07:09:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 75B408FC14; Fri, 30 Apr 2010 07:09: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 o3U79DXS093153; Fri, 30 Apr 2010 07:09:13 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U79DE4093151; Fri, 30 Apr 2010 07:09:13 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201004300709.o3U79DE4093151@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 30 Apr 2010 07:09: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: r207426 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 07:09:13 -0000 Author: trasz Date: Fri Apr 30 07:09:13 2010 New Revision: 207426 URL: http://svn.freebsd.org/changeset/base/207426 Log: Avoid undefined behaviour. Reviewed by: zec@ Modified: head/sys/netgraph/ng_pipe.c Modified: head/sys/netgraph/ng_pipe.c ============================================================================== --- head/sys/netgraph/ng_pipe.c Fri Apr 30 06:43:35 2010 (r207425) +++ head/sys/netgraph/ng_pipe.c Fri Apr 30 07:09:13 2010 (r207426) @@ -816,14 +816,17 @@ pipe_dequeue(struct hookinfo *hinfo, str } /* Randomly discard the frame, according to BER setting */ - if (hinfo->cfg.ber && - ((oldrand = rand) ^ (rand = random())<<17) >= - hinfo->ber_p[priv->overhead + m->m_pkthdr.len] ) { - hinfo->stats.out_disc_frames++; - hinfo->stats.out_disc_octets += m->m_pkthdr.len; - uma_zfree(ngp_zone, ngp_h); - m_freem(m); - continue; + if (hinfo->cfg.ber) { + oldrand = rand; + rand = random(); + if (((oldrand ^ rand) << 17) >= + hinfo->ber_p[priv->overhead + m->m_pkthdr.len]) { + hinfo->stats.out_disc_frames++; + hinfo->stats.out_disc_octets += m->m_pkthdr.len; + uma_zfree(ngp_zone, ngp_h); + m_freem(m); + continue; + } } /* Discard frame if outbound queue size limit exceeded */ From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 07:48:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B18E9106564A; Fri, 30 Apr 2010 07:48:29 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id A01D88FC08; Fri, 30 Apr 2010 07:48:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3U7mTtt001926; Fri, 30 Apr 2010 07:48:29 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U7mTPL001924; Fri, 30 Apr 2010 07:48:29 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201004300748.o3U7mTPL001924@svn.freebsd.org> From: Martin Matuska Date: Fri, 30 Apr 2010 07:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207427 - 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: Fri, 30 Apr 2010 07:48:29 -0000 Author: mm Date: Fri Apr 30 07:48:29 2010 New Revision: 207427 URL: http://svn.freebsd.org/changeset/base/207427 Log: Fix improper pool write throughput calculation. OpenSolaris onnv revision: 9366:17553395a745 PR: kern/146108 Approved by: pjd, delphij (mentor) Obtained from: OpenSolaris, Bug ID 6817339 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Apr 30 07:09:13 2010 (r207426) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Apr 30 07:48:29 2010 (r207427) @@ -300,6 +300,7 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t tx = dmu_tx_create_assigned(dp, txg); dp->dp_read_overhead = 0; + start = gethrtime(); zio = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED); while (ds = txg_list_remove(&dp->dp_dirty_datasets, txg)) { if (!list_link_active(&ds->ds_synced_link)) @@ -310,7 +311,6 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t } DTRACE_PROBE(pool_sync__1setup); - start = gethrtime(); err = zio_wait(zio); write_time = gethrtime() - start; ASSERT(err == 0); From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 07:56:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD87E1065672; Fri, 30 Apr 2010 07:56:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id BC6788FC12; Fri, 30 Apr 2010 07:56:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3U7uLnh003767; Fri, 30 Apr 2010 07:56:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U7uLAE003765; Fri, 30 Apr 2010 07:56:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201004300756.o3U7uLAE003765@svn.freebsd.org> From: Alexander Motin Date: Fri, 30 Apr 2010 07:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207428 - 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, 30 Apr 2010 07:56:21 -0000 Author: mav Date: Fri Apr 30 07:56:21 2010 New Revision: 207428 URL: http://svn.freebsd.org/changeset/base/207428 Log: Report PMP absence using target 15, same as for precence (not a wildcard), to not confuse target ID checks at SIMs. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Fri Apr 30 07:48:29 2010 (r207427) +++ head/sys/cam/ata/ata_xpt.c Fri Apr 30 07:56:21 2010 (r207428) @@ -1118,13 +1118,13 @@ ata_scan_bus(struct cam_periph *periph, work_ccb = request_ccb; /* Reuse the same CCB to query if a device was really found */ scan_info = (ata_scan_bus_info *)work_ccb->ccb_h.ppriv_ptr0; - /* Free the current request path- we're done with it. */ - xpt_free_path(work_ccb->ccb_h.path); /* If there is PMP... */ if ((scan_info->cpi->hba_inquiry & PI_SATAPM) && (scan_info->counter == scan_info->cpi->max_target)) { if (work_ccb->ccb_h.status == CAM_REQ_CMP) { - /* everything else willbe probed by it */ + /* everything else will be probed by it */ + /* Free the current request path- we're done with it. */ + xpt_free_path(work_ccb->ccb_h.path); goto done; } else { struct ccb_trans_settings cts; @@ -1132,7 +1132,7 @@ ata_scan_bus(struct cam_periph *periph, /* Report SIM that PM is absent. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, - scan_info->request_ccb->ccb_h.path, 1); + work_ccb->ccb_h.path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; cts.xport_specific.sata.pm_present = 0; @@ -1140,6 +1140,8 @@ ata_scan_bus(struct cam_periph *periph, xpt_action((union ccb *)&cts); } } + /* Free the current request path- we're done with it. */ + xpt_free_path(work_ccb->ccb_h.path); if (scan_info->counter == ((scan_info->cpi->hba_inquiry & PI_SATAPM) ? 0 : scan_info->cpi->max_target)) { From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 08:02:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D972106566B; Fri, 30 Apr 2010 08:02:09 +0000 (UTC) (envelope-from wilko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4338C8FC08; Fri, 30 Apr 2010 08:02:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3U829NI005145; Fri, 30 Apr 2010 08:02:09 GMT (envelope-from wilko@svn.freebsd.org) Received: (from wilko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U82926005143; Fri, 30 Apr 2010 08:02:09 GMT (envelope-from wilko@svn.freebsd.org) Message-Id: <201004300802.o3U82926005143@svn.freebsd.org> From: Wilko Bulte Date: Fri, 30 Apr 2010 08:02:09 +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: r207429 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 08:02:09 -0000 Author: wilko Date: Fri Apr 30 08:02:08 2010 New Revision: 207429 URL: http://svn.freebsd.org/changeset/base/207429 Log: Update email address for commit messages Approved by: core (well, me) Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Fri Apr 30 07:56:21 2010 (r207428) +++ svnadmin/conf/access Fri Apr 30 08:02:08 2010 (r207429) @@ -229,7 +229,7 @@ vanhu versus weongyo wes wes@opensail.org -wilko freebsd-commits@freebie.xs4all.nl +wilko wkbcommt@xs4all.nl will wkoszek wollman From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 08:02:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C2B9106566C; Fri, 30 Apr 2010 08:02:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2AC168FC1A; Fri, 30 Apr 2010 08:02: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 o3U82D9L005211; Fri, 30 Apr 2010 08:02:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U82D9N005209; Fri, 30 Apr 2010 08:02:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201004300802.o3U82D9N005209@svn.freebsd.org> From: Alexander Motin Date: Fri, 30 Apr 2010 08:02: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: r207430 - head/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 08:02:13 -0000 Author: mav Date: Fri Apr 30 08:02:12 2010 New Revision: 207430 URL: http://svn.freebsd.org/changeset/base/207430 Log: Add Target/LUN ID checks and deny access to targets 1-14 when PMP absent. Enforce PMA bit clearing when PMP detached to avoid further scan timeouts. Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Fri Apr 30 08:02:08 2010 (r207429) +++ head/sys/dev/ahci/ahci.c Fri Apr 30 08:02:12 2010 (r207430) @@ -2083,6 +2083,7 @@ ahci_start(device_t dev, int fbs) } /* Start operations on this channel */ cmd = ATA_INL(ch->r_mem, AHCI_P_CMD); + cmd &= ~AHCI_P_CMD_PMA; ATA_OUTL(ch->r_mem, AHCI_P_CMD, cmd | AHCI_P_CMD_ST | (ch->pm_present ? AHCI_P_CMD_PMA : 0)); } @@ -2381,6 +2382,24 @@ ahci_sata_phy_reset(device_t dev) return (1); } +static int +ahci_check_ids(device_t dev, union ccb *ccb) +{ + struct ahci_channel *ch = device_get_softc(dev); + + if (ccb->ccb_h.target_id > ((ch->caps & AHCI_CAP_SPM) ? 15 : 0)) { + ccb->ccb_h.status = CAM_TID_INVALID; + xpt_done(ccb); + return (-1); + } + if (ccb->ccb_h.target_lun != 0) { + ccb->ccb_h.status = CAM_LUN_INVALID; + xpt_done(ccb); + return (-1); + } + return (0); +} + static void ahciaction(struct cam_sim *sim, union ccb *ccb) { @@ -2396,9 +2415,12 @@ ahciaction(struct cam_sim *sim, union cc /* Common cases first */ case XPT_ATA_IO: /* Execute the requested I/O operation */ case XPT_SCSI_IO: - if (ch->devices == 0) { + if (ahci_check_ids(dev, ccb)) + return; + if (ch->devices == 0 || + (ch->pm_present == 0 && + ccb->ccb_h.target_id > 0 && ccb->ccb_h.target_id < 15)) { ccb->ccb_h.status = CAM_SEL_TIMEOUT; - xpt_done(ccb); break; } /* Check for command collision. */ @@ -2410,7 +2432,7 @@ ahciaction(struct cam_sim *sim, union cc return; } ahci_begin_transaction(dev, ccb); - break; + return; case XPT_EN_LUN: /* Enable LUN as a target */ case XPT_TARGET_IO: /* Execute target I/O request */ case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ @@ -2418,13 +2440,14 @@ ahciaction(struct cam_sim *sim, union cc case XPT_ABORT: /* Abort the specified CCB */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); break; case XPT_SET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; struct ahci_device *d; + if (ahci_check_ids(dev, ccb)) + return; if (cts->type == CTS_TYPE_CURRENT_SETTINGS) d = &ch->curr[ccb->ccb_h.target_id]; else @@ -2442,7 +2465,6 @@ ahciaction(struct cam_sim *sim, union cc if (cts->xport_specific.sata.valid & CTS_SATA_VALID_ATAPI) d->atapi = cts->xport_specific.sata.atapi; ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; } case XPT_GET_TRAN_SETTINGS: @@ -2452,6 +2474,8 @@ ahciaction(struct cam_sim *sim, union cc struct ahci_device *d; uint32_t status; + if (ahci_check_ids(dev, ccb)) + return; if (cts->type == CTS_TYPE_CURRENT_SETTINGS) d = &ch->curr[ccb->ccb_h.target_id]; else @@ -2487,48 +2511,16 @@ ahciaction(struct cam_sim *sim, union cc cts->xport_specific.sata.atapi = d->atapi; cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI; ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; } -#if 0 - case XPT_CALC_GEOMETRY: - { - struct ccb_calc_geometry *ccg; - uint32_t size_mb; - uint32_t secs_per_cylinder; - - ccg = &ccb->ccg; - size_mb = ccg->volume_size - / ((1024L * 1024L) / ccg->block_size); - if (size_mb >= 1024 && (aha->extended_trans != 0)) { - if (size_mb >= 2048) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 128; - ccg->secs_per_track = 32; - } - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); - break; - } -#endif case XPT_RESET_BUS: /* Reset the specified SCSI bus */ case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */ ahci_reset(dev); ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; case XPT_TERM_IO: /* Terminate the I/O process */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); break; case XPT_PATH_INQ: /* Path routing inquiry */ { @@ -2564,14 +2556,13 @@ ahciaction(struct cam_sim *sim, union cc if (pci_get_devid(device_get_parent(dev)) == 0x43801002) cpi->maxio = min(cpi->maxio, 128 * 512); cpi->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; } default: ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); break; } + xpt_done(ccb); } static void From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 08:22:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 258AF106566B; Fri, 30 Apr 2010 08:22:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0953A8FC13; Fri, 30 Apr 2010 08:22:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3U8Ml0E009719; Fri, 30 Apr 2010 08:22:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U8MlXq009717; Fri, 30 Apr 2010 08:22:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201004300822.o3U8MlXq009717@svn.freebsd.org> From: Alexander Motin Date: Fri, 30 Apr 2010 08:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207431 - head/sys/dev/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: Fri, 30 Apr 2010 08:22:48 -0000 Author: mav Date: Fri Apr 30 08:22:47 2010 New Revision: 207431 URL: http://svn.freebsd.org/changeset/base/207431 Log: Add Target/LUN ID checks and deny access to targets 1-14 when PMP absent. Modified: head/sys/dev/siis/siis.c Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Fri Apr 30 08:02:12 2010 (r207430) +++ head/sys/dev/siis/siis.c Fri Apr 30 08:22:47 2010 (r207431) @@ -1610,6 +1610,23 @@ siis_sata_connect(struct siis_channel *c return (1); } +static int +siis_check_ids(device_t dev, union ccb *ccb) +{ + + if (ccb->ccb_h.target_id > 15) { + ccb->ccb_h.status = CAM_TID_INVALID; + xpt_done(ccb); + return (-1); + } + if (ccb->ccb_h.target_lun != 0) { + ccb->ccb_h.status = CAM_LUN_INVALID; + xpt_done(ccb); + return (-1); + } + return (0); +} + static void siisaction(struct cam_sim *sim, union ccb *ccb) { @@ -1626,9 +1643,12 @@ siisaction(struct cam_sim *sim, union cc /* Common cases first */ case XPT_ATA_IO: /* Execute the requested I/O operation */ case XPT_SCSI_IO: - if (ch->devices == 0) { + if (siis_check_ids(dev, ccb)) + return; + if (ch->devices == 0 || + (ch->pm_present == 0 && + ccb->ccb_h.target_id > 0 && ccb->ccb_h.target_id < 15)) { ccb->ccb_h.status = CAM_SEL_TIMEOUT; - xpt_done(ccb); break; } /* Check for command collision. */ @@ -1640,7 +1660,7 @@ siisaction(struct cam_sim *sim, union cc return; } siis_begin_transaction(dev, ccb); - break; + return; case XPT_EN_LUN: /* Enable LUN as a target */ case XPT_TARGET_IO: /* Execute target I/O request */ case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ @@ -1648,13 +1668,14 @@ siisaction(struct cam_sim *sim, union cc case XPT_ABORT: /* Abort the specified CCB */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); break; case XPT_SET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; struct siis_device *d; + if (siis_check_ids(dev, ccb)) + return; if (cts->type == CTS_TYPE_CURRENT_SETTINGS) d = &ch->curr[ccb->ccb_h.target_id]; else @@ -1677,7 +1698,6 @@ siisaction(struct cam_sim *sim, union cc if (cts->xport_specific.sata.valid & CTS_SATA_VALID_TAGS) d->atapi = cts->xport_specific.sata.atapi; ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; } case XPT_GET_TRAN_SETTINGS: @@ -1687,6 +1707,8 @@ siisaction(struct cam_sim *sim, union cc struct siis_device *d; uint32_t status; + if (siis_check_ids(dev, ccb)) + return; if (cts->type == CTS_TYPE_CURRENT_SETTINGS) d = &ch->curr[ccb->ccb_h.target_id]; else @@ -1722,48 +1744,16 @@ siisaction(struct cam_sim *sim, union cc cts->xport_specific.sata.atapi = d->atapi; cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI; ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; } -#if 0 - case XPT_CALC_GEOMETRY: - { - struct ccb_calc_geometry *ccg; - uint32_t size_mb; - uint32_t secs_per_cylinder; - - ccg = &ccb->ccg; - size_mb = ccg->volume_size - / ((1024L * 1024L) / ccg->block_size); - if (size_mb >= 1024 && (aha->extended_trans != 0)) { - if (size_mb >= 2048) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 128; - ccg->secs_per_track = 32; - } - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); - break; - } -#endif case XPT_RESET_BUS: /* Reset the specified SCSI bus */ case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */ siis_reset(dev); ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; case XPT_TERM_IO: /* Terminate the I/O process */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); break; case XPT_PATH_INQ: /* Path routing inquiry */ { @@ -1790,14 +1780,13 @@ siisaction(struct cam_sim *sim, union cc cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->ccb_h.status = CAM_REQ_CMP; cpi->maxio = MAXPHYS; - xpt_done(ccb); break; } default: ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); break; } + xpt_done(ccb); } static void From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 08:37:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46D751065672; Fri, 30 Apr 2010 08:37:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2A7A98FC08; Fri, 30 Apr 2010 08:37: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 o3U8b1YY012966; Fri, 30 Apr 2010 08:37:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U8b1gO012964; Fri, 30 Apr 2010 08:37:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201004300837.o3U8b1gO012964@svn.freebsd.org> From: Alexander Motin Date: Fri, 30 Apr 2010 08:37: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: r207432 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 08:37:01 -0000 Author: mav Date: Fri Apr 30 08:37:00 2010 New Revision: 207432 URL: http://svn.freebsd.org/changeset/base/207432 Log: Add Target/LUN ID checks. Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Fri Apr 30 08:22:47 2010 (r207431) +++ head/sys/dev/ata/ata-all.c Fri Apr 30 08:37:00 2010 (r207432) @@ -1430,6 +1430,24 @@ ata_cam_end_transaction(device_t dev, st ata_reinit(dev); } +static int +ata_check_ids(device_t dev, union ccb *ccb) +{ + struct ata_channel *ch = device_get_softc(dev); + + if (ccb->ccb_h.target_id > ((ch->flags & ATA_NO_SLAVE) ? 0 : 1)) { + ccb->ccb_h.status = CAM_TID_INVALID; + xpt_done(ccb); + return (-1); + } + if (ccb->ccb_h.target_lun != 0) { + ccb->ccb_h.status = CAM_LUN_INVALID; + xpt_done(ccb); + return (-1); + } + return (0); +} + static void ataaction(struct cam_sim *sim, union ccb *ccb) { @@ -1445,10 +1463,11 @@ ataaction(struct cam_sim *sim, union ccb /* Common cases first */ case XPT_ATA_IO: /* Execute the requested I/O operation */ case XPT_SCSI_IO: + if (ata_check_ids(dev, ccb)) + return; if ((ch->devices & ((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << ccb->ccb_h.target_id)) == 0) { ccb->ccb_h.status = CAM_SEL_TIMEOUT; - xpt_done(ccb); break; } if (ch->running) @@ -1467,11 +1486,10 @@ ataaction(struct cam_sim *sim, union ccb res->lba_mid = 0x14; } ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; } ata_cam_begin_transaction(dev, ccb); - break; + return; case XPT_EN_LUN: /* Enable LUN as a target */ case XPT_TARGET_IO: /* Execute target I/O request */ case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ @@ -1479,13 +1497,14 @@ ataaction(struct cam_sim *sim, union ccb case XPT_ABORT: /* Abort the specified CCB */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); break; case XPT_SET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; struct ata_cam_device *d; + if (ata_check_ids(dev, ccb)) + return; if (cts->type == CTS_TYPE_CURRENT_SETTINGS) d = &ch->curr[ccb->ccb_h.target_id]; else @@ -1520,7 +1539,6 @@ ataaction(struct cam_sim *sim, union ccb d->atapi = cts->xport_specific.ata.atapi; } ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; } case XPT_GET_TRAN_SETTINGS: @@ -1528,6 +1546,8 @@ ataaction(struct cam_sim *sim, union ccb struct ccb_trans_settings *cts = &ccb->cts; struct ata_cam_device *d; + if (ata_check_ids(dev, ccb)) + return; if (cts->type == CTS_TYPE_CURRENT_SETTINGS) d = &ch->curr[ccb->ccb_h.target_id]; else @@ -1567,48 +1587,16 @@ ataaction(struct cam_sim *sim, union ccb cts->xport_specific.ata.valid |= CTS_ATA_VALID_ATAPI; } ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; } -#if 0 - case XPT_CALC_GEOMETRY: - { - struct ccb_calc_geometry *ccg; - uint32_t size_mb; - uint32_t secs_per_cylinder; - - ccg = &ccb->ccg; - size_mb = ccg->volume_size - / ((1024L * 1024L) / ccg->block_size); - if (size_mb >= 1024 && (aha->extended_trans != 0)) { - if (size_mb >= 2048) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 128; - ccg->secs_per_track = 32; - } - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); - break; - } -#endif case XPT_RESET_BUS: /* Reset the specified SCSI bus */ case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */ ata_reinit(dev); ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; case XPT_TERM_IO: /* Terminate the I/O process */ /* XXX Implement */ ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); break; case XPT_PATH_INQ: /* Path routing inquiry */ { @@ -1643,14 +1631,13 @@ ataaction(struct cam_sim *sim, union ccb cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; cpi->maxio = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; cpi->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); break; } default: ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); break; } + xpt_done(ccb); } static void From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 08:57:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23E4F1065673; Fri, 30 Apr 2010 08:57:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 1259F8FC0C; Fri, 30 Apr 2010 08:57: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 o3U8v3wm017377; Fri, 30 Apr 2010 08:57:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3U8v3Hl017375; Fri, 30 Apr 2010 08:57:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201004300857.o3U8v3Hl017375@svn.freebsd.org> From: Alexander Motin Date: Fri, 30 Apr 2010 08:57: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: r207433 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 08:57:04 -0000 Author: mav Date: Fri Apr 30 08:57:03 2010 New Revision: 207433 URL: http://svn.freebsd.org/changeset/base/207433 Log: Revert r198705. As scottl@ noticed, max_target/max_lun was intended to be only a hint for existing bus scanner. Some FC/SAS SIMs report fake values there, that are smaller then maximum supported IDs. In that case this check makes impossible manual scan outside hinted range. For ATA/SATA SIMs respective check was instead implemented at SIM level. Newer SCSI SIMs expected to have these checks at driver or firmware level. Some older SCSI SIMs have no this check and the issues will get back there. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Apr 30 08:37:00 2010 (r207432) +++ head/sys/cam/cam_xpt.c Fri Apr 30 08:57:03 2010 (r207433) @@ -467,34 +467,7 @@ xptioctl(struct cdev *dev, u_long cmd, c ccb = xpt_alloc_ccb(); CAM_SIM_LOCK(bus->sim); - /* Ensure passed in target/lun supported on this bus. */ - if ((inccb->ccb_h.target_id != CAM_TARGET_WILDCARD) || - (inccb->ccb_h.target_lun != CAM_LUN_WILDCARD)) { - if (xpt_create_path(&ccb->ccb_h.path, - xpt_periph, - inccb->ccb_h.path_id, - CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - error = EINVAL; - CAM_SIM_UNLOCK(bus->sim); - xpt_free_ccb(ccb); - break; - } - xpt_setup_ccb(&ccb->ccb_h, ccb->ccb_h.path, - inccb->ccb_h.pinfo.priority); - ccb->ccb_h.func_code = XPT_PATH_INQ; - xpt_action(ccb); - xpt_free_path(ccb->ccb_h.path); - if ((inccb->ccb_h.target_id != CAM_TARGET_WILDCARD && - inccb->ccb_h.target_id > ccb->cpi.max_target) || - (inccb->ccb_h.target_lun != CAM_LUN_WILDCARD && - inccb->ccb_h.target_lun > ccb->cpi.max_lun)) { - error = EINVAL; - CAM_SIM_UNLOCK(bus->sim); - xpt_free_ccb(ccb); - break; - } - } + /* * Create a path using the bus, target, and lun the * user passed in. From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 15:12:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 723FE1065677; Fri, 30 Apr 2010 15:12:30 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 62A8B8FC19; Fri, 30 Apr 2010 15:12: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 o3UFCUKp001706; Fri, 30 Apr 2010 15:12:30 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UFCU1X001704; Fri, 30 Apr 2010 15:12:30 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <201004301512.o3UFCU1X001704@svn.freebsd.org> From: Philip Paeps Date: Fri, 30 Apr 2010 15:12: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: r207436 - head/tools/tools/nanobsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 15:12:30 -0000 Author: philip Date: Fri Apr 30 15:12:30 2010 New Revision: 207436 URL: http://svn.freebsd.org/changeset/base/207436 Log: Fix typo in usage message. Add -n to the list of valid arguments. MFC after: 1 day Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Apr 30 13:54:18 2010 (r207435) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Apr 30 15:12:30 2010 (r207436) @@ -682,12 +682,12 @@ pprint() { usage () { ( - echo "Usage: $0 [-bikqvw] [-c config_file]" + echo "Usage: $0 [-biknqvw] [-c config_file]" echo " -b suppress builds (both kernel and world)" echo " -i suppress disk image build" echo " -k suppress buildkernel" echo " -n add -DNO_CLEAN to buildworld, buildkernel, etc" - echo " -q make output more quite" + echo " -q make output more quiet" echo " -v make output more verbose" echo " -w suppress buildworld" echo " -c specify config file" From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 15:22:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B9FD106564A; Fri, 30 Apr 2010 15:22:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5C0E38FC16; Fri, 30 Apr 2010 15:22: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 o3UFMqie004045; Fri, 30 Apr 2010 15:22:52 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UFMqbe004043; Fri, 30 Apr 2010 15:22:52 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004301522.o3UFMqbe004043@svn.freebsd.org> From: Alan Cox Date: Fri, 30 Apr 2010 15:22: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: r207437 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 15:22:52 -0000 Author: alc Date: Fri Apr 30 15:22:52 2010 New Revision: 207437 URL: http://svn.freebsd.org/changeset/base/207437 Log: MFamd64/i386 r207205 Clearing a page table entry's accessed bit and setting the page's PG_REFERENCED flag in pmap_protect() can't really be justified, so don't do it. Additionally, two changes that make this pmap behave like the others do: Change pmap_protect() such that it calls vm_page_dirty() only if the page is managed. Change pmap_remove_write() such that it doesn't clear a page table entry's accessed bit. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Apr 30 15:12:30 2010 (r207436) +++ head/sys/powerpc/booke/pmap.c Fri Apr 30 15:22:52 2010 (r207437) @@ -1915,16 +1915,11 @@ mmu_booke_protect(mmu_t mmu, pmap_t pmap tlb_miss_lock(); /* Handle modified pages. */ - if (PTE_ISMODIFIED(pte)) + if (PTE_ISMODIFIED(pte) && PTE_ISMANAGED(pte)) vm_page_dirty(m); - /* Referenced pages. */ - if (PTE_ISREFERENCED(pte)) - vm_page_flag_set(m, PG_REFERENCED); - tlb0_flush_entry(va); - pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED | - PTE_REFERENCED); + pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED); tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); @@ -1962,13 +1957,8 @@ mmu_booke_remove_write(mmu_t mmu, vm_pag if (PTE_ISMODIFIED(pte)) vm_page_dirty(m); - /* Referenced pages. */ - if (PTE_ISREFERENCED(pte)) - vm_page_flag_set(m, PG_REFERENCED); - /* Flush mapping from TLB0. */ - pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED | - PTE_REFERENCED); + pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED); tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 16:20:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6FF961065672; Fri, 30 Apr 2010 16:20:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 607E88FC14; Fri, 30 Apr 2010 16:20: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 o3UGKEbh016673; Fri, 30 Apr 2010 16:20:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UGKE1n016671; Fri, 30 Apr 2010 16:20:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201004301620.o3UGKE1n016671@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 30 Apr 2010 16:20: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: r207438 - 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, 30 Apr 2010 16:20:14 -0000 Author: kib Date: Fri Apr 30 16:20:14 2010 New Revision: 207438 URL: http://svn.freebsd.org/changeset/base/207438 Log: Unlock page lock instead of recursively locking it. Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Apr 30 15:22:52 2010 (r207437) +++ head/sys/vm/vm_fault.c Fri Apr 30 16:20:14 2010 (r207438) @@ -1284,19 +1284,19 @@ vm_fault_copy_entry(vm_map_t dst_map, vm vm_page_lock_queues(); vm_page_unwire(src_m, 0); vm_page_unlock_queues(); - vm_page_lock(src_m); + vm_page_unlock(src_m); vm_page_lock(dst_m); vm_page_lock_queues(); vm_page_wire(dst_m); vm_page_unlock_queues(); - vm_page_lock(dst_m); + vm_page_unlock(dst_m); } else { vm_page_lock(dst_m); vm_page_lock_queues(); vm_page_activate(dst_m); vm_page_unlock_queues(); - vm_page_lock(dst_m); + vm_page_unlock(dst_m); } vm_page_wakeup(dst_m); } From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 16:29:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0774F1065670; Fri, 30 Apr 2010 16:29:06 +0000 (UTC) (envelope-from zml@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E13928FC1D; Fri, 30 Apr 2010 16:29: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 o3UGT5E0018766; Fri, 30 Apr 2010 16:29:05 GMT (envelope-from zml@svn.freebsd.org) Received: (from zml@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UGT5ln018762; Fri, 30 Apr 2010 16:29:05 GMT (envelope-from zml@svn.freebsd.org) Message-Id: <201004301629.o3UGT5ln018762@svn.freebsd.org> From: Zachary Loafman Date: Fri, 30 Apr 2010 16:29: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: r207439 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 16:29:06 -0000 Author: zml Date: Fri Apr 30 16:29:05 2010 New Revision: 207439 URL: http://svn.freebsd.org/changeset/base/207439 Log: Handle taskqueue_drain(9) correctly on a threaded taskqueue: taskqueue_drain(9) will not correctly detect whether a task is currently running. The check is against a field in the taskqueue struct, but for a threaded queue with more than one thread, multiple threads can simultaneously be running a task, thus stomping over the tq_running field. Submitted by: Matthew Fleming Reviewed by: jhb Approved by: dfr (mentor) Modified: head/sys/kern/subr_taskqueue.c head/sys/sys/_task.h head/sys/sys/taskqueue.h Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Fri Apr 30 16:20:14 2010 (r207438) +++ head/sys/kern/subr_taskqueue.c Fri Apr 30 16:29:05 2010 (r207439) @@ -51,7 +51,6 @@ struct taskqueue { const char *tq_name; taskqueue_enqueue_fn tq_enqueue; void *tq_context; - struct task *tq_running; struct mtx tq_mutex; struct thread **tq_threads; int tq_tcount; @@ -233,13 +232,13 @@ taskqueue_run(struct taskqueue *queue) STAILQ_REMOVE_HEAD(&queue->tq_queue, ta_link); pending = task->ta_pending; task->ta_pending = 0; - queue->tq_running = task; + task->ta_flags |= TA_FLAGS_RUNNING; TQ_UNLOCK(queue); task->ta_func(task->ta_context, pending); TQ_LOCK(queue); - queue->tq_running = NULL; + task->ta_flags &= ~TA_FLAGS_RUNNING; wakeup(task); } @@ -256,14 +255,16 @@ taskqueue_drain(struct taskqueue *queue, { if (queue->tq_spin) { /* XXX */ mtx_lock_spin(&queue->tq_mutex); - while (task->ta_pending != 0 || task == queue->tq_running) + while (task->ta_pending != 0 || + (task->ta_flags & TA_FLAGS_RUNNING) != 0) msleep_spin(task, &queue->tq_mutex, "-", 0); mtx_unlock_spin(&queue->tq_mutex); } else { WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); mtx_lock(&queue->tq_mutex); - while (task->ta_pending != 0 || task == queue->tq_running) + while (task->ta_pending != 0 || + (task->ta_flags & TA_FLAGS_RUNNING) != 0) msleep(task, &queue->tq_mutex, PWAIT, "-", 0); mtx_unlock(&queue->tq_mutex); } Modified: head/sys/sys/_task.h ============================================================================== --- head/sys/sys/_task.h Fri Apr 30 16:20:14 2010 (r207438) +++ head/sys/sys/_task.h Fri Apr 30 16:29:05 2010 (r207439) @@ -36,15 +36,21 @@ * taskqueue_run(). The first argument is taken from the 'ta_context' * field of struct task and the second argument is a count of how many * times the task was enqueued before the call to taskqueue_run(). + * + * List of locks + * (c) const after init + * (q) taskqueue lock */ typedef void task_fn_t(void *context, int pending); struct task { - STAILQ_ENTRY(task) ta_link; /* link for queue */ - u_short ta_pending; /* count times queued */ - u_short ta_priority; /* Priority */ - task_fn_t *ta_func; /* task handler */ - void *ta_context; /* argument for handler */ + STAILQ_ENTRY(task) ta_link; /* (q) link for queue */ + u_int ta_flags; /* (q) state of this task */ +#define TA_FLAGS_RUNNING 0x01 + u_short ta_pending; /* (q) count times queued */ + u_short ta_priority; /* (c) Priority */ + task_fn_t *ta_func; /* (c) task handler */ + void *ta_context; /* (c) argument for handler */ }; #endif /* !_SYS__TASK_H_ */ Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Fri Apr 30 16:20:14 2010 (r207438) +++ head/sys/sys/taskqueue.h Fri Apr 30 16:29:05 2010 (r207439) @@ -75,6 +75,7 @@ void taskqueue_thread_enqueue(void *cont (task)->ta_priority = (priority); \ (task)->ta_func = (func); \ (task)->ta_context = (context); \ + (task)->ta_flags = 0; \ } while (0) /* From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 17:08:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F4451065672; Fri, 30 Apr 2010 17:08:28 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3E1468FC1A; Fri, 30 Apr 2010 17:08: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 o3UH8SPA027409; Fri, 30 Apr 2010 17:08:28 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UH8STt027406; Fri, 30 Apr 2010 17:08:28 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004301708.o3UH8STt027406@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 30 Apr 2010 17:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207440 - stable/8/sys/dev/ipw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 17:08:28 -0000 Author: bschmidt Date: Fri Apr 30 17:08:27 2010 New Revision: 207440 URL: http://svn.freebsd.org/changeset/base/207440 Log: MFC r206763-206767: r206763: Fix comment about ipw_assoc and remove some whitespaces; no functional changes. r206764: Pass correct RSSI to ieee80211_input*(). r206765: - Make ipw usable again by moving directly into ASSOC state. - No need to manually switch to RUN state, assoc response takes care of that. r206766: Use iv_appie_wpa, with this commit WPA works again. r206767: Remove IPW_LOCK_DECL and fix various LORs. Approved by: rpaulo (mentor) Modified: stable/8/sys/dev/ipw/if_ipw.c stable/8/sys/dev/ipw/if_ipwvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ipw/if_ipw.c ============================================================================== --- stable/8/sys/dev/ipw/if_ipw.c Fri Apr 30 16:29:05 2010 (r207439) +++ stable/8/sys/dev/ipw/if_ipw.c Fri Apr 30 17:08:27 2010 (r207440) @@ -888,10 +888,10 @@ ipw_newstate(struct ieee80211vap *vap, e /* * XXX when joining an ibss network we are called * with a SCAN -> RUN transition on scan complete. - * Use that to call ipw_auth_and_assoc. On completing - * the join we are then called again with an - * AUTH -> RUN transition and we want to do nothing. - * This is all totally bogus and needs to be redone. + * Use that to call ipw_assoc. On completing the + * join we are then called again with an AUTH -> RUN + * transition and we want to do nothing. This is + * all totally bogus and needs to be redone. */ if (ostate == IEEE80211_S_SCAN) ipw_assoc(ic, vap); @@ -904,12 +904,19 @@ ipw_newstate(struct ieee80211vap *vap, e break; case IEEE80211_S_AUTH: + /* + * Move to ASSOC state after the ipw_assoc() call. Firmware + * takes care of authentication, after the call we'll receive + * only an assoc response which would otherwise be discared + * if we are still in AUTH state. + */ + nstate = IEEE80211_S_ASSOC; ipw_assoc(ic, vap); break; case IEEE80211_S_ASSOC: /* - * If we are not transitioning from AUTH the resend the + * If we are not transitioning from AUTH then resend the * association request. */ if (ostate != IEEE80211_S_AUTH) @@ -1021,7 +1028,6 @@ ipw_rx_newstate_intr(struct ipw_softc *s } sc->flags &= ~IPW_FLAG_ASSOCIATING; sc->flags |= IPW_FLAG_ASSOCIATED; - ieee80211_new_state(vap, IEEE80211_S_RUN, -1); break; case IPW_STATE_SCANNING: @@ -1034,8 +1040,10 @@ ipw_rx_newstate_intr(struct ipw_softc *s * we checked the 802.11 layer state. */ if (sc->flags & IPW_FLAG_ASSOCIATED) { + IPW_UNLOCK(sc); /* XXX probably need to issue disassoc to fw */ ieee80211_beacon_miss(ic); + IPW_LOCK(sc); } break; @@ -1054,7 +1062,9 @@ ipw_rx_newstate_intr(struct ipw_softc *s break; } if (sc->flags & IPW_FLAG_SCANNING) { + IPW_UNLOCK(sc); ieee80211_scan_done(vap); + IPW_LOCK(sc); sc->flags &= ~IPW_FLAG_SCANNING; sc->sc_scan_timer = 0; } @@ -1064,13 +1074,16 @@ ipw_rx_newstate_intr(struct ipw_softc *s DPRINTFN(2, ("Association lost (%s flags 0x%x)\n", IEEESTATE(vap), sc->flags)); sc->flags &= ~(IPW_FLAG_ASSOCIATING | IPW_FLAG_ASSOCIATED); - if (vap->iv_state == IEEE80211_S_RUN) + if (vap->iv_state == IEEE80211_S_RUN) { + IPW_UNLOCK(sc); ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); + IPW_LOCK(sc); + } break; case IPW_STATE_DISABLED: /* XXX? is this right? */ - sc->flags &= ~(IPW_FLAG_HACK | IPW_FLAG_SCANNING | + sc->flags &= ~(IPW_FLAG_HACK | IPW_FLAG_SCANNING | IPW_FLAG_ASSOCIATING | IPW_FLAG_ASSOCIATED); DPRINTFN(2, ("Firmware disabled (%s flags 0x%x)\n", IEEESTATE(vap), sc->flags)); @@ -1164,7 +1177,6 @@ ipw_rx_data_intr(struct ipw_softc *sc, s bus_addr_t physaddr; int error; int8_t rssi, nf; - IPW_LOCK_DECL; DPRINTFN(5, ("received frame len=%u, rssi=%u\n", le32toh(status->len), status->rssi)); @@ -1234,10 +1246,10 @@ ipw_rx_data_intr(struct ipw_softc *sc, s IPW_UNLOCK(sc); ni = ieee80211_find_rxnode(ic, mtod(m, struct ieee80211_frame_min *)); if (ni != NULL) { - (void) ieee80211_input(ni, m, rssi, nf); + (void) ieee80211_input(ni, m, rssi - nf, nf); ieee80211_free_node(ni); } else - (void) ieee80211_input_all(ic, m, rssi, nf); + (void) ieee80211_input_all(ic, m, rssi - nf, nf); IPW_LOCK(sc); bus_dmamap_sync(sc->rbd_dmat, sc->rbd_map, BUS_DMASYNC_PREWRITE); @@ -1378,8 +1390,11 @@ ipw_fatal_error_intr(struct ipw_softc *s struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); device_printf(sc->sc_dev, "firmware error\n"); - if (vap != NULL) + if (vap != NULL) { + IPW_UNLOCK(sc); ieee80211_cancel_scan(vap); + IPW_LOCK(sc); + } ieee80211_runtask(ic, &sc->sc_init_task); } @@ -1388,7 +1403,6 @@ ipw_intr(void *arg) { struct ipw_softc *sc = arg; uint32_t r; - IPW_LOCK_DECL; IPW_LOCK(sc); @@ -1718,7 +1732,6 @@ static void ipw_start(struct ifnet *ifp) { struct ipw_softc *sc = ifp->if_softc; - IPW_LOCK_DECL; IPW_LOCK(sc); ipw_start_locked(ifp); @@ -1775,7 +1788,9 @@ ipw_watchdog(void *arg) DPRINTFN(3, ("Scan timeout\n")); /* End the scan */ if (sc->flags & IPW_FLAG_SCANNING) { + IPW_UNLOCK(sc); ieee80211_scan_done(TAILQ_FIRST(&ic->ic_vaps)); + IPW_LOCK(sc); sc->flags &= ~IPW_FLAG_SCANNING; } } @@ -1791,7 +1806,6 @@ ipw_ioctl(struct ifnet *ifp, u_long cmd, struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; int error = 0, startall = 0; - IPW_LOCK_DECL; switch (cmd) { case SIOCSIFFLAGS: @@ -2201,7 +2215,6 @@ ipw_assoc(struct ieee80211com *ic, struc struct ipw_security security; uint32_t data; int error; - IPW_LOCK_DECL; IPW_LOCK(sc); error = ipw_disable(sc); @@ -2260,8 +2273,8 @@ ipw_assoc(struct ieee80211com *ic, struc if (error != 0) goto done; - if (vap->iv_appie_assocreq != NULL) { - struct ieee80211_appie *ie = vap->iv_appie_assocreq; + if (vap->iv_appie_wpa != NULL) { + struct ieee80211_appie *ie = vap->iv_appie_wpa; error = ipw_setwpaie(sc, ie->ie_data, ie->ie_len); if (error != 0) goto done; @@ -2291,7 +2304,6 @@ ipw_disassoc(struct ieee80211com *ic, st struct ifnet *ifp = vap->iv_ic->ic_ifp; struct ieee80211_node *ni = vap->iv_bss; struct ipw_softc *sc = ifp->if_softc; - IPW_LOCK_DECL; IPW_LOCK(sc); DPRINTF(("Disassociate from %6D\n", ni->ni_bssid, ":")); @@ -2327,7 +2339,6 @@ ipw_init(void *priv) struct ipw_softc *sc = priv; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - IPW_LOCK_DECL; IPW_LOCK(sc); ipw_init_locked(sc); @@ -2534,7 +2545,6 @@ static void ipw_stop(void *priv) { struct ipw_softc *sc = priv; - IPW_LOCK_DECL; IPW_LOCK(sc); ipw_stop_locked(sc); @@ -2661,7 +2671,6 @@ ipw_scan_start(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; struct ipw_softc *sc = ifp->if_softc; - IPW_LOCK_DECL; IPW_LOCK(sc); ipw_scan(sc); @@ -2673,7 +2682,6 @@ ipw_set_channel(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; struct ipw_softc *sc = ifp->if_softc; - IPW_LOCK_DECL; IPW_LOCK(sc); if (ic->ic_opmode == IEEE80211_M_MONITOR) { @@ -2701,7 +2709,6 @@ ipw_scan_end(struct ieee80211com *ic) { struct ifnet *ifp = ic->ic_ifp; struct ipw_softc *sc = ifp->if_softc; - IPW_LOCK_DECL; IPW_LOCK(sc); sc->flags &= ~IPW_FLAG_SCANNING; Modified: stable/8/sys/dev/ipw/if_ipwvar.h ============================================================================== --- stable/8/sys/dev/ipw/if_ipwvar.h Fri Apr 30 16:29:05 2010 (r207439) +++ stable/8/sys/dev/ipw/if_ipwvar.h Fri Apr 30 17:08:27 2010 (r207440) @@ -164,13 +164,6 @@ struct ipw_softc { * NB.: This models the only instance of async locking in ipw_init_locked * and must be kept in sync. */ -#define IPW_LOCK_DECL int __waslocked = 0 -#define IPW_LOCK(sc) do { \ - if (!(__waslocked = mtx_owned(&(sc)->sc_mtx))) \ - mtx_lock(&sc->sc_mtx); \ -} while (0) -#define IPW_UNLOCK(sc) do { \ - if (!__waslocked) \ - mtx_unlock(&sc->sc_mtx); \ -} while (0) +#define IPW_LOCK(sc) mtx_lock(&sc->sc_mtx); +#define IPW_UNLOCK(sc) mtx_unlock(&sc->sc_mtx); #define IPW_LOCK_ASSERT(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 17:11:40 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4541D1065670; Fri, 30 Apr 2010 17:11:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 8CC2F8FC12; Fri, 30 Apr 2010 17:11:39 +0000 (UTC) Received: from c122-106-173-187.carlnfd1.nsw.optusnet.com.au (c122-106-173-187.carlnfd1.nsw.optusnet.com.au [122.106.173.187]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o3UHBY7Z001445 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 1 May 2010 03:11:36 +1000 Date: Sat, 1 May 2010 03:11:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Jeff Roberson In-Reply-To: <201004300421.o3U4LMmV056220@svn.freebsd.org> Message-ID: <20100501024249.C13811@delplex.bde.org> References: <201004300421.o3U4LMmV056220@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r207421 - head/sbin/tunefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 17:11:40 -0000 On Fri, 30 Apr 2010, Jeff Roberson wrote: > Log: > - Use the path to the filesystem mountpoint to look up the statfs > structure so that we correctly reload. Note that tunefs doesn't > properly detect the need to reload if the disk device is specified > for a read-only mounted filesystem. I think I fixed this long ago (using the getmntpt() function which should be in a library). The patch also fixes many style bugs (but far from all, and there are many more now). % Index: tunefs.c % =================================================================== % RCS file: /home/ncvs/src/sbin/tunefs/tunefs.c,v % retrieving revision 1.42 % diff -u -2 -r1.42 tunefs.c % --- tunefs.c 9 Apr 2004 19:58:40 -0000 1.42 % +++ tunefs.c 10 Apr 2004 02:10:11 -0000 % @@ -46,6 +46,6 @@ % */ % #include % -#include % #include % +#include % #include % % @@ -58,4 +58,5 @@ % #include % #include % +#define _LIBUFS % #include % #include % @@ -71,6 +72,7 @@ % #define sblock disk.d_fs % % -void usage(void); % +struct statfs *getmntpt(const char *); % void printfs(void); % +void usage(void); % % int % @@ -78,7 +80,6 @@ % { % char *avalue, *Lvalue, *lvalue, *nvalue; % - const char *special, *on; % - const char *name; % - int active; % + const char *name, *special; % + struct statfs *stfsp; % int Aflag, aflag, eflag, evalue, fflag, fvalue, Lflag, lflag; % int mflag, mvalue, nflag, oflag, ovalue, pflag, sflag, svalue; % @@ -86,5 +87,4 @@ % const char *chg[2]; % struct ufs_args args; % - struct statfs stfs; % % if (argc < 3) % @@ -94,5 +94,4 @@ % avalue = Lvalue = lvalue = nvalue = NULL; % evalue = fvalue = mvalue = ovalue = svalue = 0; % - active = 0; % found_arg = 0; /* At least one arg is required. */ % while ((ch = getopt(argc, argv, "Aa:e:f:L:l:m:n:o:ps:")) != -1) % @@ -101,5 +100,5 @@ % case 'A': % found_arg = 1; % - Aflag++; % + Aflag = 1; % break; % % @@ -108,7 +107,7 @@ % name = "ACLs"; % avalue = optarg; % - if (strcmp(avalue, "enable") && % - strcmp(avalue, "disable")) { % - errx(10, "bad %s (options are %s)", % + if (strcmp(avalue, "enable") != 0 && % + strcmp(avalue, "disable") != 0) { % + errx(10, "bad %s option (options are %s)", % name, "`enable' or `disable'"); % } % @@ -141,12 +140,13 @@ % Lvalue = optarg; % i = -1; % - while (isalnum(Lvalue[++i])); % + while (isalnum(Lvalue[++i])) % + ; % if (Lvalue[i] != '\0') { % errx(10, % - "bad %s. Valid characters are alphanumerics.", % + "bad %s (valid characters are alphanumerics)", % name); % } % if (strlen(Lvalue) >= MAXVOLLEN) { % - errx(10, "bad %s. Length is longer than %d.", % + errx(10, "bad %s (length is longer than %d)", % name, MAXVOLLEN - 1); % } % @@ -158,7 +158,7 @@ % name = "multilabel MAC file system"; % lvalue = optarg; % - if (strcmp(lvalue, "enable") && % - strcmp(lvalue, "disable")) { % - errx(10, "bad %s (options are %s)", % + if (strcmp(lvalue, "enable") != 0 && % + strcmp(lvalue, "disable") != 0) { % + errx(10, "bad %s option (options are %s)", % name, "`enable' or `disable'"); % } % @@ -170,5 +170,5 @@ % name = "minimum percentage of free space"; % mvalue = atoi(optarg); % - if (mvalue < 0 || mvalue > 99) % + if (mvalue < 0 || mvalue > 100) % errx(10, "bad %s (%s)", name, optarg); % mflag = 1; % @@ -181,5 +181,5 @@ % if (strcmp(nvalue, "enable") != 0 && % strcmp(nvalue, "disable") != 0) { % - errx(10, "bad %s (options are %s)", % + errx(10, "bad %s option (options are %s)", % name, "`enable' or `disable'"); % } % @@ -224,12 +224,14 @@ % usage(); % % - on = special = argv[0]; % + special = argv[0]; % if (ufs_disk_fillout(&disk, special) == -1) % goto err; % - if (disk.d_name != special) { % + if (disk.d_name != special) % special = disk.d_name; % - if (statfs(special, &stfs) == 0 && % - strcmp(special, stfs.f_mntonname) == 0) % - active = 1; % + stfsp = getmntpt(special); % + if (stfsp != NULL) { % + if (pflag == 0 && (stfsp->f_flags & MNT_RDONLY) == 0) % + errx(1, % + "cannot work on read-write mounted file system"); % } % % @@ -238,23 +240,17 @@ % exit(0); % } % - if (Lflag) { % - name = "volume label"; % - strlcpy(sblock.fs_volname, Lvalue, MAXVOLLEN); % - } % if (aflag) { % name = "ACLs"; % if (strcmp(avalue, "enable") == 0) { % - if (sblock.fs_flags & FS_ACLS) { % + if (sblock.fs_flags & FS_ACLS) % warnx("%s remains unchanged as enabled", name); % - } else { % + else { % sblock.fs_flags |= FS_ACLS; % warnx("%s set", name); % } % } else if (strcmp(avalue, "disable") == 0) { % - if ((~sblock.fs_flags & FS_ACLS) == % - FS_ACLS) { % - warnx("%s remains unchanged as disabled", % - name); % - } else { % + if ((~sblock.fs_flags & FS_ACLS) == FS_ACLS) % + warnx("%s remains unchanged as disabled", name); % + else { % sblock.fs_flags &= ~FS_ACLS; % warnx("%s cleared", name); % @@ -274,28 +270,29 @@ % if (fflag) { % name = "average file size"; % - if (sblock.fs_avgfilesize == fvalue) { % + if (sblock.fs_avgfilesize == fvalue) % warnx("%s remains unchanged as %d", name, fvalue); % - } % else { % warnx("%s changes from %d to %d", % - name, sblock.fs_avgfilesize, fvalue); % + name, sblock.fs_avgfilesize, fvalue); % sblock.fs_avgfilesize = fvalue; % } % } % + if (Lflag) { % + name = "volume label"; % + strlcpy(sblock.fs_volname, Lvalue, MAXVOLLEN); % + } % if (lflag) { % name = "multilabel"; % if (strcmp(lvalue, "enable") == 0) { % - if (sblock.fs_flags & FS_MULTILABEL) { % + if (sblock.fs_flags & FS_MULTILABEL) % warnx("%s remains unchanged as enabled", name); % - } else { % + else { % sblock.fs_flags |= FS_MULTILABEL; % warnx("%s set", name); % } % } else if (strcmp(lvalue, "disable") == 0) { % - if ((~sblock.fs_flags & FS_MULTILABEL) == % - FS_MULTILABEL) { % - warnx("%s remains unchanged as disabled", % - name); % - } else { % + if ((~sblock.fs_flags & FS_MULTILABEL) == FS_MULTILABEL) % + warnx("%s remains unchanged as disabled", name); % + else { % sblock.fs_flags &= ~FS_MULTILABEL; % warnx("%s cleared", name); % @@ -309,5 +306,5 @@ % else { % warnx("%s changes from %d%% to %d%%", % - name, sblock.fs_minfree, mvalue); % + name, sblock.fs_minfree, mvalue); % sblock.fs_minfree = mvalue; % if (mvalue >= MINFREE && sblock.fs_optim == FS_OPTSPACE) % @@ -318,6 +315,6 @@ % } % if (nflag) { % - name = "soft updates"; % - if (strcmp(nvalue, "enable") == 0) { % + name = "soft updates"; % + if (strcmp(nvalue, "enable") == 0) { % if (sblock.fs_flags & FS_DOSOFTDEP) % warnx("%s remains unchanged as enabled", name); % @@ -326,15 +323,17 @@ % name); % } else { % - sblock.fs_flags |= FS_DOSOFTDEP; % - warnx("%s set", name); % + sblock.fs_flags |= FS_DOSOFTDEP; % + warnx("%s changes from disabled to enabled", % + name); % } % - } else if (strcmp(nvalue, "disable") == 0) { % + } else if (strcmp(nvalue, "disable") == 0) { % if ((~sblock.fs_flags & FS_DOSOFTDEP) == FS_DOSOFTDEP) % warnx("%s remains unchanged as disabled", name); % else { % - sblock.fs_flags &= ~FS_DOSOFTDEP; % - warnx("%s cleared", name); % + sblock.fs_flags &= ~FS_DOSOFTDEP; % + warnx("%s changes from enabled to disabled", % + name); % } % - } % + } % } % if (oflag) { % @@ -346,5 +345,5 @@ % else { % warnx("%s changes from %s to %s", % - name, chg[sblock.fs_optim], chg[ovalue]); % + name, chg[sblock.fs_optim], chg[ovalue]); % sblock.fs_optim = ovalue; % if (sblock.fs_minfree >= MINFREE && % @@ -357,10 +356,9 @@ % if (sflag) { % name = "expected number of files per directory"; % - if (sblock.fs_avgfpdir == svalue) { % + if (sblock.fs_avgfpdir == svalue) % warnx("%s remains unchanged as %d", name, svalue); % - } % else { % warnx("%s changes from %d to %d", % - name, sblock.fs_avgfpdir, svalue); % + name, sblock.fs_avgfpdir, svalue); % sblock.fs_avgfpdir = svalue; % } % @@ -370,12 +368,13 @@ % goto err; % ufs_disk_close(&disk); % - if (active) { % + if (stfsp != NULL) { % bzero(&args, sizeof(args)); % - if (mount("ufs", on, % - stfs.f_flags | MNT_UPDATE | MNT_RELOAD, &args) < 0) % + if (mount("ufs", stfsp->f_mntonname, % + stfsp->f_flags | MNT_UPDATE | MNT_RELOAD, &args) < 0) % err(9, "%s: reload", special); % warnx("file system reloaded"); % } % exit(0); % + % err: % if (disk.d_error != NULL) % @@ -399,4 +398,5 @@ % printfs(void) % { % + /* XXX mounds of style bugs. */ % warnx("ACLs: (-a) %s", % (sblock.fs_flags & FS_ACLS)? "enabled" : "disabled"); % @@ -424,2 +424,36 @@ % sblock.fs_volname); % } % + % +/* % + * Get the mount info for a ufs file system mounted on `name'. % + * XXX adapted from fsck_ffs/main.c. % + */ % +struct statfs * % +getmntpt(name) % + const char *name; % +{ % + struct stat devstat, mntdevstat; % + char devnamebuf[sizeof(_PATH_DEV) - 1 + MNAMELEN]; % + char *devnamep; % + struct statfs *mntbuf; % + int i, mntsize; % + % + if (stat(name, &devstat) != 0 || % + !(S_ISCHR(devstat.st_mode) || S_ISBLK(devstat.st_mode))) % + return (NULL); % + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); % + for (i = 0; i < mntsize; i++) { % + if (strcmp(mntbuf[i].f_fstypename, "ufs") != 0) % + continue; % + devnamep = mntbuf[i].f_mntfromname; % + if (*devnamep != '/') { % + strcpy(devnamebuf, _PATH_DEV); % + strcat(devnamebuf, devnamep); % + devnamep = devnamebuf; % + } % + if (stat(devnamep, &mntdevstat) == 0 && % + mntdevstat.st_rdev == devstat.st_rdev) % + return (&mntbuf[i]); % + } % + return (NULL); % +} Back to the change in the commit... > Modified: head/sbin/tunefs/tunefs.c > ============================================================================== > --- head/sbin/tunefs/tunefs.c Fri Apr 30 03:35:05 2010 (r207420) > +++ head/sbin/tunefs/tunefs.c Fri Apr 30 04:21:22 2010 (r207421) > @@ -280,9 +280,9 @@ main(int argc, char *argv[]) > if (ufs_disk_fillout(&disk, special) == -1) > goto err; > if (disk.d_name != special) { > - special = disk.d_name; > - if (statfs(special, &stfs) == 0 && > - strcmp(special, stfs.f_mntonname) == 0) > + if (statfs(special, &stfs) != 0) > + warn("Can't stat %s", special); > + if (strcmp(special, stfs.f_mntonname) == 0) > active = 1; This introduces undefined behaviour when statfs() failed. stfs then consists of stack garbage, but f_mntonname in it is used. Since f_mntonname is an array whose contents is unlikely to match the leading bytes of `special', the undefined behaviour is likely to be benign. This has 1 style bug (capitalization of the warning message). There used to be no other instance of this bug in tunefs, but recent changes added many more instances, mostly of the form "Failed to ..." and "Journal file ...". This doesn't actually implement the beheviour described in the log message. It doesn't change the path to the filesystem mountpoint to look up the statfs struct; it only adds a warning when the lookup fails. > } > Bruce From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 17:12:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF45E1065670; Fri, 30 Apr 2010 17:12:20 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id AFE7B8FC16; Fri, 30 Apr 2010 17:12: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 o3UHCK9m028287; Fri, 30 Apr 2010 17:12:20 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UHCKvd028285; Fri, 30 Apr 2010 17:12:20 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201004301712.o3UHCKvd028285@svn.freebsd.org> From: Randall Stewart Date: Fri, 30 Apr 2010 17:12: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: r207441 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 17:12:20 -0000 Author: rrs Date: Fri Apr 30 17:12:20 2010 New Revision: 207441 URL: http://svn.freebsd.org/changeset/base/207441 Log: Bug in the memory mapping module. The wrong physaddr was being used in the macro (1 should be used not 2)... Obtained from: JC Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Apr 30 17:08:27 2010 (r207440) +++ head/sys/mips/mips/pmap.c Fri Apr 30 17:12:20 2010 (r207441) @@ -236,7 +236,7 @@ caddr_t virtual_sys_start = (caddr_t)0; sched_pin(); \ va1 = sysm->base; \ va2 = sysm->base + PAGE_SIZE; \ - npte = mips_paddr_to_tlbpfn(phys2) | \ + npte = mips_paddr_to_tlbpfn(phys1) | \ PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ pte = pmap_pte(kernel_pmap, va1); \ *pte = npte; \ From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 18:04:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E17F6106564A; Fri, 30 Apr 2010 18:04:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D1B368FC13; Fri, 30 Apr 2010 18:04: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 o3UI4khN040002; Fri, 30 Apr 2010 18:04:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UI4kbQ039999; Fri, 30 Apr 2010 18:04:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004301804.o3UI4kbQ039999@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 30 Apr 2010 18:04: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: r207442 - head/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 18:04:47 -0000 Author: yongari Date: Fri Apr 30 18:04:46 2010 New Revision: 207442 URL: http://svn.freebsd.org/changeset/base/207442 Log: Disable non-ASF packet flushing on Yukon Extreme as vendor's driver does. Without this change, Yukon Extreme seems to generate lots of RX FIFO overruns even though controller has available RX buffers. These excessive RX FIFO overruns generated lots of pause frames which in turn killed devices plugged into switch. It seems there is still occasional RX frame corruption on Yukon Extreme but this change seems to fix the pause frame storm. Reported by: jhb Tested by: jhb MFC after: 5 days Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Apr 30 17:12:20 2010 (r207441) +++ head/sys/dev/msk/if_msk.c Fri Apr 30 18:04:46 2010 (r207442) @@ -3917,6 +3917,11 @@ msk_init_locked(struct msk_if_softc *sc_ msk_stop(sc_if); return; } + if (sc->msk_hw_id == CHIP_ID_YUKON_EX) { + /* Disable flushing of non-ASF packets. */ + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), + GMF_RX_MACSEC_FLUSH_OFF); + } /* Configure interrupt handling. */ if (sc_if->msk_port == MSK_PORT_A) { Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Fri Apr 30 17:12:20 2010 (r207441) +++ head/sys/dev/msk/if_mskreg.h Fri Apr 30 18:04:46 2010 (r207442) @@ -1941,6 +1941,8 @@ #define RX_TRUNC_OFF BIT_26 /* disable packet truncation */ #define RX_VLAN_STRIP_ON BIT_25 /* enable VLAN stripping */ #define RX_VLAN_STRIP_OFF BIT_24 /* disable VLAN stripping */ +#define GMF_RX_MACSEC_FLUSH_ON BIT_23 +#define GMF_RX_MACSEC_FLUSH_OFF BIT_22 #define GMF_RX_OVER_ON BIT_19 /* enable flushing on receive overrun */ #define GMF_RX_OVER_OFF BIT_18 /* disable flushing on receive overrun */ #define GMF_ASF_RX_OVER_ON BIT_17 /* enable flushing of ASF when overrun */ From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 18:13:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE19D1065672; Fri, 30 Apr 2010 18:13:12 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id BA9BC8FC16; Fri, 30 Apr 2010 18:13: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 o3UIDCtw041881; Fri, 30 Apr 2010 18:13:12 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UIDCN0041877; Fri, 30 Apr 2010 18:13:12 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004301813.o3UIDCN0041877@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 30 Apr 2010 18:13: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: r207443 - in stable/8/sys: conf contrib/dev/iwn dev/iwn modules/iwnfw/iwn6000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 18:13:12 -0000 Author: bschmidt Date: Fri Apr 30 18:13:11 2010 New Revision: 207443 URL: http://svn.freebsd.org/changeset/base/207443 Log: MFC r206443-206446, 206474-206477, 207001 r206443: Small whitespace cleanup. r206444 [1]: - Rename bluetooth coexistence flags, no binary change. - Enable DC calibration and crystal calibration on Centrino Advanced-N 6250 parts. - Workaround for a HW bug (does not affect 4965AGN) that may sporadically affect latency under some rare circumstances. From a similar commit to iwlwifi. - Update sensitivity settings for 5000 series to workaround a performance bug in the DSP (1000 is not affected so we keep the old values for 5000). - Update sensitivity settings for 6000 series. - Set differential gains on 6250 too (but use a 1.0 factor, not 1.5). - Init OFDM sensitivity with min value (which depends on the chip) instead of hardcoding it to 90. - Read calibration version from ROM and set IWN_GP_DRIVER_CALIB_VER6 bit on 6x50 if version >= 6. r206445 [2]: iwn4965_set_txpower() uses maxpwr from EEPROM to calculate the power to set, it make sense to actually initialize that array. This fixes some issues with 4965 adapters where the TX power is crucial. This got lost somewhere while merging with the OpenBSD code. r206446: Update firmware for the 6000 series Intel cards to version 9.193.4.1. r206474: Add some missing protoypes. r206475: iwn5000_reset_sched() is not used; #ifdef it. r206476: Hook ieee80211_media_change() to ieee80211_vap_attach(). r206477: Declare all functions as static. r207001 [3]: Use correct bus_dma_tag_t for TX frames. Approved by: rpaulo (mentor) Obtained from: Openbsd [1], [2] Reported by: Andreas Nilsson [3] Added: stable/8/sys/contrib/dev/iwn/iwlwifi-6000-9.193.4.1.fw.uu - copied unchanged from r206446, head/sys/contrib/dev/iwn/iwlwifi-6000-9.193.4.1.fw.uu Deleted: stable/8/sys/contrib/dev/iwn/iwlwifi-6000-9.176.4.1.fw.uu Modified: stable/8/sys/conf/files stable/8/sys/contrib/dev/iwn/LICENSE stable/8/sys/dev/iwn/if_iwn.c stable/8/sys/dev/iwn/if_iwnreg.h stable/8/sys/dev/iwn/if_iwnvar.h stable/8/sys/modules/iwnfw/iwn6000/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Fri Apr 30 18:04:46 2010 (r207442) +++ stable/8/sys/conf/files Fri Apr 30 18:13:11 2010 (r207443) @@ -1178,7 +1178,7 @@ iwn6000fw.fwo optional iwn6000fw | iwn clean "iwn6000fw.fwo" iwn6000.fw optional iwn6000fw | iwnfw \ dependency ".PHONY" \ - compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000-9.176.4.1.fw.uu" \ + compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-6000-9.193.4.1.fw.uu" \ no-obj no-implicit-rule \ clean "iwn6000.fw" dev/ixgb/if_ixgb.c optional ixgb Modified: stable/8/sys/contrib/dev/iwn/LICENSE ============================================================================== --- stable/8/sys/contrib/dev/iwn/LICENSE Fri Apr 30 18:04:46 2010 (r207442) +++ stable/8/sys/contrib/dev/iwn/LICENSE Fri Apr 30 18:13:11 2010 (r207443) @@ -1,39 +1,39 @@ -Copyright (c) 2006-2009, Intel Corporation. +Copyright (c) 2006-2010, Intel Corporation. All rights reserved. -Redistribution. Redistribution and use in binary form, without -modification, are permitted provided that the following conditions are +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are met: -* Redistributions must reproduce the above copyright notice and the - following disclaimer in the documentation and/or other materials - provided with the distribution. -* Neither the name of Intel Corporation nor the names of its suppliers - may be used to endorse or promote products derived from this software - without specific prior written permission. -* No reverse engineering, decompilation, or disassembly of this software +* Redistributions must reproduce the above copyright notice and the + following disclaimer in the documentation and/or other materials + provided with the distribution. +* Neither the name of Intel Corporation nor the names of its suppliers + may be used to endorse or promote products derived from this software + without specific prior written permission. +* No reverse engineering, decompilation, or disassembly of this software is permitted. -Limited patent license. Intel Corporation grants a world-wide, -royalty-free, non-exclusive license under patents it now or hereafter -owns or controls to make, have made, use, import, offer to sell and -sell ("Utilize") this software, but solely to the extent that any -such patent is necessary to Utilize the software alone, or in -combination with an operating system licensed under an approved Open -Source license as listed by the Open Source Initiative at -http://opensource.org/licenses. The patent license shall not apply to -any other combinations which include this software. No hardware per +Limited patent license. Intel Corporation grants a world-wide, +royalty-free, non-exclusive license under patents it now or hereafter +owns or controls to make, have made, use, import, offer to sell and +sell ("Utilize") this software, but solely to the extent that any +such patent is necessary to Utilize the software alone, or in +combination with an operating system licensed under an approved Open +Source license as listed by the Open Source Initiative at +http://opensource.org/licenses. The patent license shall not apply to +any other combinations which include this software. No hardware per se is licensed hereunder. -DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copied: stable/8/sys/contrib/dev/iwn/iwlwifi-6000-9.193.4.1.fw.uu (from r206446, head/sys/contrib/dev/iwn/iwlwifi-6000-9.193.4.1.fw.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/contrib/dev/iwn/iwlwifi-6000-9.193.4.1.fw.uu Fri Apr 30 18:13:11 2010 (r207443, copy of r206446, head/sys/contrib/dev/iwn/iwlwifi-6000-9.193.4.1.fw.uu) @@ -0,0 +1,8152 @@ +Copyright (c) 2006-2010, Intel Corporation. +All rights reserved. + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +* Redistributions must reproduce the above copyright notice and the + following disclaimer in the documentation and/or other materials + provided with the distribution. +* Neither the name of Intel Corporation nor the names of its suppliers + may be used to endorse or promote products derived from this software + without specific prior written permission. +* No reverse engineering, decompilation, or disassembly of this software + is permitted. + +Limited patent license. Intel Corporation grants a world-wide, +royalty-free, non-exclusive license under patents it now or hereafter +owns or controls to make, have made, use, import, offer to sell and +sell ("Utilize") this software, but solely to the extent that any +such patent is necessary to Utilize the software alone, or in +combination with an operating system licensed under an approved Open +Source license as listed by the Open Source Initiative at +http://opensource.org/licenses. The patent license shall not apply to +any other combinations which include this software. No hardware per +se is licensed hereunder. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. +begin-base64 644 iwlwifi-6000-9.193.4.1.fw.uu +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 +ANvPcaAAqCAngagQDQBZYbFxwiVFEMol5hKweArZdP0d/s9wgADcRgCQz3agAMQnUSAAgQTyjCUD +kgT3AN8V8M9woAC0D3ygz3CrAKD/eqAWCCAKANgZFgCWgOAE8gLYEB4YkAHfGRYAloDgPvRRIQDG +PPQD2c9woADUCzGg4HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44Hjg +eOB44HjgeOB44HjgeOB44HjgeDGgE8zPcYAAgAxqvREaHDAUgQHgFKEVgbhgFaHGDO/8AdiOCmAB +Adi3/SUB7/zpcOB48cC2CO/8wNjPdYAA7KdBjSAaAjASakTgz3GgANQL2IEA20ImDhiA5somzBDR +cEYADgDPcZ8AuP8Ygc9ygACQBJC4GKEYgbC4GKEgggWBAeAFoc9xgAC0oR2Bg7gdoSCCiiDFCHIO +r/wlgQDYGf8A2D3wz3aAABwPyYYD4AQggA8AAPz/Kr7Avhe+x3YADgAAxXjsdgCmCMjsdgCmEczP +dqAAiCRKJMBzAeAQeAQggA8AAP+/j7gRGhwwHqYA3qggAALwJY8T7HDgoAHmgOIA3cv3z3CAACio +8CBOA+xwwKAB5VB1t/dtoQHYNQDP/OB4wdggGgIwz3KAABwPGIoB289xgAC0oYbgFoHCI8EADOAY +IMAAYhkEAGIRAAED4AQggA8AAPz/nbifuOxzAKMIyOxzAKMYijaBhuAB2MIgAQAYIQEA7HAgoOB/ +AdjxwG4Pr/wb2M92oADEJxUWDZYWHhiQA9nPcKAA1AsxoOB44HjgeOB44HjgeOB44HjgeOB44Hjg +eOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HgxoBPMERocMIogBAweDa/8 +ANl6/eS9E/LPcIAAkAQggBGBAeARoUD9GRYAloDgBfIC2BAeGJBe/iLwUhYAllMgQQCD4dEl4ZAD +8rf+GPDPcIAAOQgB2SCoz3CAAJAEQIAGggHgBqLPcIAAtKEegFEgwIEG8s9wgAB0BSCg/QaP/PHA +jg6v/ADZz3AAAP9/z3WgAMQnEx0YkBvYFh0YkAHYEB0YkM92gAC0oR6G8bgF8qgeQBAI8BGGNoaW +DmACANqoHgAQb/4dhue4BPIA2CXwLRUBllaGMHIG8oC4HaYA2JH+9vEEJYFfAADwLx6GJXgephEV +AZbpuQXyz3AAALirC/DwuQTyAtiIHgQQ4LkH8s9wAAB4rmUGj/xRIcCAG/II2BMdGJAD/4Dg0vUC +2DwdAJAhFQGWz3CAAGSqIaARFQCWUSCAgAf0Tv4dhlEgwIG+9REVBZZRJYCADPQKIcAP63IF2Ioj +RggxAq/7iiSDDwTYEx0YkIv/qvHgePHA4cXPcoAAtKEWgpjgz3GAAISqBfJUEoAAgOAE8hmCuoIE +8BuCvIJRgs9z/v//P2R4pHsEIoIPAAAAEEV4AKEA2AGhZXpJoQ7aSqHPcYAAYMoaCoABz3CAALDH +AIBRIECACPLPcYAAUM0CCqABAdiVBY/88cAODY/8z3GAAAAAAIFRIACAG/IBgVEgAIBA2M8g4gfK +IIEPAADQAM8g4QfPcp8AuP8dogSBAeDTuAShBSCAD9D+AAAWogDez3WAALSh3aXepVQdghPfpYDY +lB0CEM9wgAAIrdmgz3CAAHCqwKDPcIAA7MbCoBTMgB2AE1EgwICIHYQTqB2AEw7yFcxTIECACvLP +cIAAHA8JgFEgQIBKIUAgBPJKIQAgz3CgAAQl1KAw2c9woABQDCKgEcwTGhwwwPxRIYDDz3eAABwP +z3GAAEyMHfIA2I64HqXPcIAAkARU4SCgG5cctR2Xkh0EEIoghA4etYogRAtCCq/8ANkG2c9woADI +HCmgE/DPcIAAkAQE4SCgGpcctRyXkh0EEE4XABEetYoghAsSCq/8ANnPcYAAkARAgQCCAeAAoiCB +AYEB4AGh+tgeCK//ANnU/IDg6AcBAM9woAAMJM9xAAD/fyGgz3CgANAPERAAhoDgDfIKIcAP63IF +2IojTgyKJIMPKQCv+7hzAdnPcKAA0A8RGFiAaBeBEByVAiBQAB6F7rgaAiEALyAIJEAdhBPPcKoA +AAQCgM9xpQAIDCCBBCCCDwAAAP8ougQhgQ8AAADgO3mJuiV6KIcEIb6PAAYAAFGlA/KMulGlz3OA +AOynTaMMo89xqgAABCCBRBWCEJTiKqMZ8gb2iuIZ9CO5DvC34g7y7uIT9EUp/gJBKcFwUSDAgcIh +YgAA2AvwRSn+AkEpAXH68SK5+PEA2QHYNqXPcqoAAARBgjyzS6PkusogYgDhusogYQCGIv4PQSoE +ARATBQFJHQIRHaUFJQIBSLNVIcMG4LjPcgAAfA8JI4IAA/IA2DvwjuGM96AXAxBwcQj3z3OgANAP +gBMDAHBxCfKAuB2lmgiv/IogBQjr8c9woADQDxkQAIZCIAAISCAAABBy3PfPcZ8AuP8YgZC4GKEY +gbC4GKHPcYAAkARAgQWCAeAFoh2FIIGDuB2liiDFCE4Ir/wlgcfxAdiA4An0AN/PdaAA1AsA2Iz9 +MwYAAApwANkA/mIXgBBEFYEQBCBEAIYh/wNCKQUBRCQCAaByz3GAABzLwbpJYYm5O6VsFYMQSRWB +EAQjDwCGI/8DRLskf39nz3OAAAhx9CPPA0odghNeHcQTz3eAAAzOSmeJulylcBWCEER4hiL/AyR4 +RLpYYPQjAAAEIQEBYB0EEBGFoHHPcoAAKHH0IkMAGaXPcoAAOHH0IkEAih3EEBqljB3EEI4dRBCQ +HUQQYQIgAADfz3CmAAgEAYAEIIAPMAAAADS4USBAxkAdBBBAFQERC/TPcKAAqCAIgBlhMHl+DW// +CnAD8Apwx/0EIIBPgAEAANdwAAEAAADfFvQB2JYVghBKHQIQz3CAAOynKJAEuom6QB3EE0kdwhP2 +pemgRXkosOXwSR3CE89wpgCMA12AUSDAxwQigQ84AAAAQSnABJYdAhAEIoAPAAAA8Cy4JbkleBGl +z3WAALShBfIRhYy4EaVTIsECRBWEEDalUSQAgNEi4ocA2AP0AdjPdoAA7KdJppYVghBolgS6ZXpI +tnGFPLZTJMIAXHrPd4AADMtPZx2l+6VsFY8Qw78vJcEDz3eAALyo9CdPEW2mXh3EE893gAD8zU9n +eaX8pXAVjxDDvy8lwQPPd4AAvKj0J08ReqVgHcQTz3eAANyo9CeFEM9zpgCMA893gADsqPQnghCK +HUQRjB1EEY4dhBCQHYQQfYMEI48PAQAAADC/Sh3CE2mmShWDEIDjANoZ8kwkQIMK8oC4HaWKIEUI ++g1v/IohUQAdhVEgAIAH8nXwggiv/IogkQNRIADG+/NI8FUhzgbguM9zAAB8DwkmwxAE8gDYPPCO +4Y/3z3aAAJgPyYbRcQn3z3egANAPgBcOENFxCPKAuB2log1v/IogBQjq8RkXAJZCIAAIgODKIIwA +EHPb989xnwC4/xiBz3KAAJAEkLgYoRiBsLgYoSCCBYEB4AWhHYUggoO4HaWKIMUIWg1v/CWBxvEB +2IDgJ/IA30whAKDPdoAAtKEH8haGjuAF9B6GkbgepkoWgBCA4Br0yXXPcKAAeCZC2TKgHoXxuLwC +AgCQ/YDgrAIBAMr9gOCsAgIAoQIAAADYvvyZAiAAAN+KIMUA8gxv/IohEQvPcaYA1AQsEQCANBER +gDgRDYDLERIGKnHGualyhiL9Dwa6RXkqcoYi/Q8EukV5BCCCDwIAAAAnukV5RCUCHA26RXmpcoYi +8w8EIIAPOAAAAA66RXkluCV4RCWBEBS5JXiIuEQlARJBKcGAUiBABRGmVB5CEMohgg8AAP//yiGB +DwAAEB8acTaGP7YEIYEv/wMA/yi5NqZ6DiACANryvageABA98kQWghAxhqDi0SHhgjXyBCGEjwAA +AAEI8s9zgAAAcEtjgeMK9gQhgw8AAAAk13MAAAAkI/IEIYMPBgAAADG7guM2AA0AguML9EwkAIAV +8s9zgAAAcEtjguMP9EwkAIAE8sziC/Z2hhJzyiOODwEAiA3MIM6AzffXcAEAiA3H989ygACADDaC +AeE2ogHZGvDPc4AAAHBKY89zgAAwjGaTcHIP9uu5CvLPcYAAHA8ogQQhvo8ABgAABfJKIAAgA/AC +2RpxVBaBEM9ygADspygaQAQHuWiSiLlleSiyNoYwGoAEPLIxhquiBCWNHwgAAgAdsi2i13UIAAAA +1AjhC8ogAQQWhoDgdB4AFAT0tgjAC2rwz3GgANAPgBEBADBwCvJPIAEgPabPcoAARI0gggHhIKJU +FoEQgOFs4AvyCSCBDwAAagbPcKAA0A8iGFiABvDPcQAAfA8JIEEAz3CgANAPGRAAhkIgAAhIIAAA +EHFCAA4Az3GfALj/GIGQuBihGIGwuBihz3GAAJAEQIEFggHgBaIdhiCBg7gdpoogxQiqCm/8JYHP +cYAARI0CgQHgAqEdhkQg/oIU8oYgv40K8oogxQuGCm/8iiESB0ECz//PcYAARI0JgQHgCaGd/ATw +AgoP/s91oADUCy/wbf0KJgCQLvQD2M91oADUCxGl4HjgeOB44HjgeOB44HjgeOB44HjgeOB44Hjg +eOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeBGlE8wRGhww8KUxBE/8HoXxuAPy +QH7I8RTMhiD/hQXyA8gBgP24AvKO/e4IwAjz8eB48cDhxQh1z3CAADCiC4DPcaAAyB9k4B6hENgO +oQHYFRkYgAXwTgxv/HvYAYWA4AX0USMAwPjzAYXBuIPgD/TPcIAAOQgB2SCoz3CAAJAEIIAGgQHg +BqEA2BbwAYVRIACAB/TPcYAAtKEdgYK4HaEBhVEgQIAH9M9xgAC0oR2BhLgdoQHYrQNP/PHAz3CA +AGiocgxv/BjZz3CAAFCoZgxv/BjZLwdP/+B4AdoA2c9woAC0D1ygz3CAAMCNKaB1BG/7GNjgeKHB +8cDOCk/8CHdacs9ygAAAAACCmnFRIMCBocE6cxvyAYJRIMCBQNjPIOIHyiCBDwAA0ADPIOEHz3Gf +ALj/HaEEggHg07gEogUggA/Q/gAAFqHPcYAA2K4mgQDYgeEB2cB5gOdAKRMDP/LPc4AAtKGUE4EA +57kJ9M9wgAAohQS5IGAtuMC46XGGIfwAjCEChRR7EfTPcIAASAUAgFEggIAF8iDdjhMOAQjwmN2K +Ew4BBPBeEw4BDt2KIIUAWghv/KlxiiCFAFIIb/zJcc9wgABwqgCA4LjAJSIRsHovIIgjSidAIAnw +z3GAAHCqAKH6cAh1GnAIcs9zgADsxiCDg+EF9CODUSHAgAr0SiEAIAomQCQKIEA0CiVAJIHwwBMC +ADgSgwA3EoEACLtleTkSgwAQu2V5OhKDABi7ZXk0EoMAQCEQBDMSgQAvIAgkCLtleTUSgwAQu2V5 +NhKDAM9yoAD8RBi7ZXlAIRUBXYIA2VEigIHMISKgCfIvIkgFOnH6cdpxG3FL8E8j0yNBLEIjwLoE +ulR6inHGuUkhwQU0elEkwKLPcYAAoHJRYQbyQSkCARQiQQAouQPhz3YAAPz/BCGDA89xgABAokiJ +z3GAACiFBLpBYUAgECHyuS8gCCQH8nt7QCAQIS8gCCRAJcEhJH4II4IDAiKYA1EgAIDAJSERJ20E +IYEPAAD8/wgjQAACIFYAGmJQeoohAiACEgEhQCAAJTBwSPYCIQEESCEBADB5QMEE8ADYQMAvIEgE +inEKc6YKIAJKJAAACiQAoD70CtjPcaAAyB8eoRDYDqEB2BUZGIAG8EoJb/yKIMoHUSAAww30z3Cg +APxEHYAEIL6PMAAAAAX0USMAwO7zUSMAwMohwg/KIsIHyiBiAcojgg8AAKUCyiQiAOAEIvvKJSIA +USAAwwDYCfTPcYAAgAwJgQHgCaEA2Ji4mnBMJACgyiUiEMogQgPI9EwhAKDPdoAAcKoX8s9woAD0 +B62gz3CAAGjHMYBbiRqJCLpFeAS2XYkciQi6RXgFtgCGgbgApgPwANgCpkwnAKCa8gCGUSAAgDvy +z3CAAOyhTIjPcIAAAHAyIIQAH9lMJACAANrc989wAwAUAFZ4z3OjALD/UOBgYM91AwAYAFZ9UOVj +ZS8oAQAB4i8rwQACezBzyiHFAJByqPdALEABQiAACBlhz3CAAGhzKGAhhk8j0yMJuAV5AoYleAKm +BSPAIw1xALENcQDAALEMEgEgDXAgoBASASENcCCwiiCFAGINL/zpcYwnApUU8ownA5Eb8ownA5Uh +8gohwA/rcgXYz3MAAAgMiiSDD6kDL/u4c89wgACQBCCAD4EB4A+hEgngAUpwEPDPcIAAkAQggA6B +AeAOoQjwz3CAAJAEIIANgQHgDaEAhoDgBvIihg1wIKAA2ACmTCEAoM9xoAD0BwDYEvIHoQHYC6ED +2AihTBmABQHYA/AA2KpxC3JKc0YKoAsAFAQwz3KgAPQHANkkogHdgOAB2DIKoAvAeADBACEABM9x +oADIH/gRAgBCeEggAABfgRB4UHBKAAUADBICIM9wgABkqkKgoNgPoQDYH6HPcoAAcA/PcIAAtKFV +ihyQQngAwkwkAKBYYB+hAtgVGRiABfJRIEDGINgC8oDYDqGMJwOVB/TPcIAAtKEckAjwjCcDkQn0 +z3CAACyiDZD6C2//ANnyDA//FMyGIPmPCvSMJwORANjPIKEDyiAiARQaHDDPcIAAAAAAgFEgwIEG +8s9xnwC4/wDYHaHPcYAAcKoA2AChqXAI3N8FL/yhwPHAsg0v/ADZCHUBgMG4g+DKIEEgyiBBAAXy +qXB4/kogQCCB4BHyEIVRIICBRfIQhc92gAC0oVEgwIEa8s9wgABwDwKIGPAB2wDfOfAA31UmQBrp +cZDafgggAQDbQCUAEpweABAA2AW1BNsp8AWFJoWmDkABUSDAgZQeAhAH8h2Glbgdph6Gl7geph+G +BCC+jxBwAADKJyIQ6PWcuB+mz3CAALDHAIBRIECA0vMQhe24zvMB383xAN/pc89ygAC0oVQSjgDP +caAA9CaA5s9wgABkqhH0z3aAABKi9CbOE1yS2mLPdoAAcA/VjsJ6ELqAugLwAtpDoSWFTCAAoCGg +DvTPcIAAOQgB2SCoz3CAAJAEIIAGgQHgBqGOCw//+QQv/Ghw4HjxwI4ML/yQ2aLBCHZBwSGGwbmD +4QDYyiABIAbyyXAv/kogQCDPcaAALCAmgYHgAN8weRzyEIZRIICBNPLPdYAAtKEclRBxyfYlhs9w +gABkqgKAEHGr9BCGUSDAgQjyz3CAAHAPAogI8AHYQvAFhiaGgg1AAT+FBCG+jxBwAACUHQIQEPTP +cYAAsMcggVEhQIAB2UfyUIbtukPyQMEod0PwAN8j8ItwgOAD8gLbYKADgYDig7gDoQXyAIKmuACi +LBYAAAShDBYAAAWhAMEBwlUlQBreDuAAAdsfhZ64H6VAJgASnB0AEJ4KD/8A2M91gAC0oVQVghCA +4s9xoAD0JmX0z3KAABKi9CLDA1yVemLPc4AAcA91i2J6ELqAulbwQMcA31EgwIHT9W2GBYbPcYAA +7MaBwgQjgw/AAAAAAoE2uxEgwIBAJgYSQCEECyHyBZYcEQcAQiAFBPQkwwAIJ0ABcHDX9s9woAAs +IA+AgOAR9M9woAAsIGaAHJVwcCgHxv/PcIAAZKpigAWBEHOM8wOBUSDAgJXzANrPcKAA/ESeukGg +A4GjuAOhi/HPcYAAkARAgQuCAeALoiCBiiBFC/YIL/wrgW7xAtpDoUWGTCAAoM9xgABkqkGhDfTP +cYAAOQgB2kCpz3GAAJAEQIEmggHhJqIBAy/8osDxwJoKD/wIdhXMUyBAgAryBxIBNgDYmBEBAIYK +4AAIcgGGwbiD4MonIRDKJcETBvLJcKz9CHUB34HlyiNhAEPyEIZRIICBBfQA22hwPPAUzFEgwIAs +8hXMUyBAgBsSAjYP9AAigQ+AABCXAdgAqc9xgAA4TjKJUSEAgOgLggAQ2BQaHDDPcYAARI0SgQHg +EqEDyBsSATaEEAIBz3CAAASXNXgpgFlhKaAI3dDxz3CAAMiMK4AB4SugAggv/IogxQkA2wHYAtnP +cqAA9CYjokOGgOfPcYAAZKpBoQ70z3GAADkIAdpAqc9xgACQBECBJoIB4SaigOAK8gDYnrjPcaAA +/EQBoQDYBaGCCA//9QEv/AUjQAPxwIoJD/wIdgGAwbiD4ADdyiBBAwTyyXBt/QHdgeAA2SzyEIZR +IICBKPIUzM9ygABMjFEgQIEZ8kDYFBocMFASAAYB4FAaGAAbyM9ygACIlhR6IKoDEgE2ANiYEQEA +LgngAAhyCvCkEgEAAeGkGkAANg/v+4ogBQoC2c9woAD0JiOgI4aA5c9wgABkqiGgDvTPcIAAOQgB +2SCoz3CAAJAEIIAGgQHgBqHOD8/+SQEv/ADY4HjxwM9ygAC0oVQSgQCA4RT0PJLPcoAAcA9UikJ5 +ELlFIUMBz3GgAPQmY6EA2s9xgABkqkGhOf2B4MogYQAE8oYPz/4A2KMED//xwIYID/wIdRpxQSkA +Ac9xgAAgc8O4CGEklQQhgQ8AAACA13EAAACAAdnAeTV4IZUE4TBwDfKMIAKkCfTPcIAAtKEWgIwg +AoYD8hDYl/AklVoO7/uKIMQLjCACrCLyDvaMIAKgRPKMIAKkZvKMIAKoh/SpcJj+g/CMIAOkFfII +9owgA6B99Klwn/958IwgA6jMIIKvAADwAHP0qXDH/2/wqXDW/mvwz3GAAAAAAIFRIACBG/IBgVEg +AIFA2M8g4gfKIIEPAADQAM8g4QfPcp8AuP8dogSBAeDTuAShBSCAD9D+AAAWoqlwQv9J8M9ygAAA +AACCUSAAgRryAYJRIACBQNjPIOIHyiCBDwAA0ADPIOEHz3GfALj/HaEEggHg07gEogUggA/Q/gAA +FqFqC2ABqXAl8M9xgAAAAACBUSAAgRryAYFRIACBQNjPIOIHyiCBDwAA0ADPIOEHz3KfALj/HaIE +gQHg07gEoQUggA/Q/gAAFqKaDWABqXBxB8/7TXEqDe/7iiCFCGHx4HjxwP4Oz/vPdoAAtKEfhgQg +vo8AcAAAWfIvKQEAz3CAAAAF9CBNAJwWAhAA36QWARBPJYAQ6XP1/IDgEPSMJQOQz3GAAPwMBvQU +gQHgFKE98BOBAeAToTnwH4b+uC/yz3WAADhOEI0ujRBxLfISjVEgwIAp9DCtUgigAAPYUSAAwxn0 +ANmeuc9woAD8RCGgMI2GIf8BQ7kQuU8hwgbPcYAArLQgiZ+6gOEB2cB5D7lFeS2gEo2EuBKtBfDP +cIAAUK7gqEIMgAGhBs/74HjxwOHFpgkv/wDdz3GAALShHYFRIMCBXvTPcKAABCWigAQljR//AF// +UyWAEIfgRfRRIoDTQfIegfq4P/QEIL6PAB4AAA7yB/DPcAAADgqeDs/7USKAwPr1USIAwM8lYhHP +cYAAtKEegfm4zyUiEs8l4hLPJaITIfT7uBLyiL2JvY29TyXAEr2BjrgEJY0fAgAAAFIlTRQqvQV9 +D/D8uMUlgh8AAAAFzyXiEs8lohPFJYEfAAAAB89wgABAogiIxLgYuFEggMQFfWAJIvzKICII2QXv ++6lw4HjxwFoN7/sIcs9xgAC0oQCRiBEDAc91oADQD0QgBAMKJsCQQNsQHdiQQiyEAIYg/APKJmIQ +qBEPAEAuhRXPc4AA7Kfwfv2z/JMQvuV+DB2Yk2GLArtI4xAd2JBiEQ4BiBEDAdtjwJFwe1EmgJJE +uGIZxAAG9C6RUyHBgBDyz3CAABwPCYBRIACAPdjAKOIFyiChB8AoIQYK8EAsAQE4YM9xgACYQwhh +F7gD4wUgQAEEI4MPAAD8/2V4nbifuAwdGJARzAHgEHgEIIAPAAD/v4+4ERocMA4dmJAgFQCWz3CA +ABwPCIDruBDy5LoO9HINb/1IcM9wgACIoKDZxNo923YO7/sXu70Ez/vxwE4M7/uKIQgAz3WAAGSi +z3CgAAwkIaDElc9wgAC0oR6AGnbxuIYg/CNJ8lElgNFF8owgA6RD9APZz3CgANQLMaDgeOB44Hjg +eOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB4 +MaCpcE3+USDAgAbyz3CAAICoFg0AAs9xoADEJxkRAIaA4ATyAtgQGRiABNgTGRiAG9gWGRiAkvAu +CWAECnAId6lwCnHB/gh2I/9EJn6UDvJRJgCRCPLPcYAAtKEdgYC4HaEBhYoPz/568IDnDPJM/89x +gAC0oT2BUSHAgXD0fv8r8APZz3CgANQLMaDgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44Hjg +eOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB4MaATzBEaHDBRJsCQB/LPcIAAgKhKDAAC +z3WgAMQnERUAllEggIAA3hr0Ug7P/s9wgAC0oR2AUSDAgSr0ERUFllElgIAM9AohwA/rcgXYiiNJ +DUEHr/qKJIMPBNgTHRiQG9gWHRiQz3WAAAitGYWA4AXygg9AAdmlz3CAAAAAAIBRIACBBvLPcJ8A +uP/doNUCz/vxwHYK7/tN2M9yoADEJy0SDoYJuBoaGIDPcIAACKIgiIDhocEG8gHbz3GgANQLcqEE +2RAaWIBNcYYh8w+MIQyAAdnAeTlhNHkAiB7hgODKJUEQBPJAIQ0DIn4H8M9wAADsD8oKz/tRIIDE +BfRRIQDG9vPPcaAA0A8QGViDJREAhmDAJREAhg95ARwCMAAUADGMINiBzCCCjwAABwjKICIAB/SI +4QHYwHhmDSALLm7PcqAAxCcaEgGGBCGBD////wAaGliAERIBhuu5CfIA2Yu5ExpYgBrZGRpYgAkC +7/uhwPHAjgnP+892gAC0oc9woAAMJDyAVoahwQIiQABkuBB4hh4EEBByyiHOD8oizgfKIG4ByiOO +DwAAJAXKJC4A5AWu+solDgEDyAGA/bgJ8i8ghwqMIAKGBfQehp64HqbPdaAAxCchFRCWJg8ABIDg +HAIhAJgeABDPcoAAAAAAguu4GfIBguu4QNjPIOIHyiCBDwAA0ADPIOEHz3GfALj/HaEEggHg07gE +ogUggA/Q/gAAFqFRJcDRz3WAABwPBPJWFYAQBvADhi4KIAEkhj6GlB4CEEQhAAyg4Af0USXA0gX0 +gNiUHgIQlBaAEFEgwIEE8pe5PqZRIYCBJ/IUllEgQIEj9FoNgAeA4B/0z3CgACwgD4CA4AXyA8gB +gP24FfIehpC4HqbPcIAAsMcAgFEgQIAF8lElQNMB2QL0ANmLcJDabgugAADbz3CAALShlBCBAEAp +AgaGIf0PUiHBAUW5RXnPcqAAiCQwoimF47legATy6boE8gDYA/AB2FEhAIHRImKCANnKIWIA97ol +eA94FvRRIoDTEvKA4BD0RCI+0wz0z3CAALShAYBRIACABPJyDwAEBPBuCEAEz3WAALShHoXzuCPy +BNnPcKAAkCM9oE1x4g2v+4ogRA4F8HII7/uKIFYLUSCAxAX0USEAxvfzz3WAALShhhUAEc9xgAAc +D74PoAQvkRXwAJUEIIAPAADMgNdwAADIgAj0C4VRIACABPJA/wfwBNnPcKAAkCM9oALYz3egAMQn +PB8AkJQVgBDPcYAAZKpRIMCBBBkABAnyHYWVuB2liiAFCVoNr/sA2UH+CHYdhVEgwIEKAgIAUyZA +EIPgB/QVFwCWUSDAgFzyMgvv/slw7wEAAM9xgADIjA2BAeANoQPZz3CgANQLMaDgeOB44HjgeOB4 +4HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB4MaAT +zM9xgABkqhEaHDAQ2BAdGJAC2DwdAJASCu/+BBkABB2GUSDAgbf0ERUFllElgIAL9AohwA/rcgXY +iiPXCAUDr/qKJIMPBNgTHRiQG9gWHRiQofAUzFEgwIA+hQvyBCGADwBAQADXcABAQAAD9Ji5PqXw +uRLyAMHU2KlyQgtv/wHbgOAE8jIMQAEI8M9xgAD8DBOBAeAToc9wgAA5CAHf4KjPcIAAkAQggAaB +AeAGoR6F87iMC8IEHoXwuOQMgf4ehVEgwIEH8gHZz3CAAHQFIKDPcaAAyBwA2AehMNgKoclwHv6K +IIQN6guv+8lxA8gBgP24FfIehfi4E/IQ2BQaHDDPcIAAgKgCD8ABG8gAIIEPgAAQlx6F4Km4uB6l +AJWGIPwAjCACgC70fgnABIDgKvQD2c9woADUCzGg4HjgeOB44HjgeOB44HjgeOB44HjgeOB44Hjg +eOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeOB44HjgeDGgE8wRGhwwHoXzuAX0AJWCD+AF +NJWBBa/7ocDPcoAAcA9UillhMHlBaVBwxPYieBB4A/AC2M9xoADIHx+hiiAYCA6hAtgVGRiA4H7x +wOIMj/vPcIAAAAYAgIDgoAvCBs92gAAAAACGUSDAgEogACAa8gGGUSDAgEDYzyDiB8oggQ8AANAA +zyDhB89xnwC4/x2hBIYB4NO4BKYFIIAP0P4AABahFMzguADfQPLPcaAAyB+wEQIAz3OAABwPahMA +AWO4CCIAAB6hENgOoQHaz3CAAGSmFRmYgAMaGDDPcIAAKKcHGhgwCIPruAnyz3CgALRHSxjYg3cY +mIBSDgACz3CAABAFAIiA4AXy9gqACDYMgAgEIJFPMAAAAM9yoAAsIM91oADIHzPw7bjKJYEfoADI +H8oigQ+gACwgJ/LiDs/+z3CAAMCNCYCMIAKNiPdODa/6GNjPcKAAtA/8oM9wgAAcDwiA67gI8gDZ +nrnPcKAA/EQioBTMz3WgAMgfz3KgACwg77ga9AohACTPcYAAgAzjoeWhA4LTAiAAB6H+DK/6GNgA +389woAC0D/ygz3WgAMgftwIgABp2BNgKGhgwH4WA4IogDADKIIIPAAAAAg6lA9gVuBIdGJDPcIAA +AAYAgIDgOArCBgCGBCC+jwAA33jWAwEAz3CfALj//aDLAwAACsjPcZ8AuP8Woc9wnwC4/1gYAAge +hVEgQMU68grIhiDxjzb0z3WAAIAMA4UB4AOl7g3v/gHez3CAAMCNCYCMIAKNXAfG/89wgAAcDwiA +67gH8gDYnrjPcaAA/EQCoc9wgAC0oR2AhiC+jwXyBYUB4AWlz3CAAAAAAIDruAbyANnPcJ8AuP89 +oEogQCAUzOS4DfTmuBv0hiD/hUzyUSMAwAnyUSBAxQf0HvAVzFMgQIAG9M91oADIHwDf1/AHyAMS +ATYDGhgwBxpYMIIMAALPcIAAEAUAiIDg7fMmCYAIZgqACOnxFMzPdYAARI1RIMCANvKA2BQaHDAV +zOu4B/IYhQHgGKVKIAAgBPAQhQHgEKXPcIAAOE4SiFEgAIDgCyIAyiBiAEwhAKAE8heFAeAXpRTM +57gA31fyFcwEIIAPAAAAGNdwAAAACB30hg0gAQpwUSAAgBXyCNibuBDwiiAEABQaHDAPhUwhAKAB +4A+l4vMWhQHgFqXe8QoaGDBy8ATY/PGSDIAAFcxRIMCAIPLPcaAALCAFgSaBCuAwcDH3AxIBNgLY +FBocMFDY6g0gAJgRAQCaCwACz3CAABAFAIiA4FDyPgiACH4JgAhM8APIoBAAAPC46XAa8vIJgAAA +2Ja4FPDouBXyAgugAIogBAAmDKAA6XUDyKAQAADwuKlwBvLKCYAAANiVuGIMgAC58em4z3KgAMgf +CPKyCaAAAdgA2JC49PHuuAvyUSMAwAfyiiAEAA6iBNgKGhgwFRIBN++5EPJAEgIGz3CAACyiDZAQ +coj3r7kVGlwwz3CAAOzG4KDPdaAAyB8KyAQgvo8DgOhDkAXC/1EgQMWIBcL/P4WgFQAQCSEAAOTg +0vbPcIAACJkAgFEgQIAM8v6lEN5yDaADyXCA4AT0Adgepc6liiAIAKAdwBMOpR+FqOBJ94DgBfSK +IAQADqV2DcAHL9iVuBIdGJDPcAEAwPwVHRiQbgmAAM9ygABQBQCCh+Ag8s9woAA4LgWABCCAD8AA +AADXcMAAAAAP8vXZBbnPcJ8AuP86oAfZO6Bp2Ri5OaAB2ALwANiB4AT0B9gAos9wgAAABgCAgODo +DoIGz3GAAIAMA4FEgQgiAAAEoQWBRoEIIgAABqF8hQeBSIECewDKCCLCAIjgSKEK9APZz3CgAEAt +MKAAGsIzBfAB4AAaAjDPcIAAAAAAgAQgvo8AAN94BvLPcJ8AuP/9oM9wgAAcDwiA67gV8s9wgADc +AxB4z3GgALRHSRkYgM9wAEQUAEsZGIBMGdiDA9h3GRiAyQdP++B4z3CAABgFQIjgugjyz3GgAKwv +GYGKuBmhUSJAgAfyz3GgAKwvGYGOuBmh4H7xwOHFB9kbGlgwz3CgANQHGhhYgA4QDYbPcYAAAABA +gVEiAIILGlgzGvJBgVEiAIJA2s8i4gfKIoEPAADQAM8i4QfPc58AuP9do0SBAeLTukShBSKCD9D+ +AABWo89xoABILL6hHxAAhgIaGDAIypzgzCCCjwAAkQAF8gAWAEAAFgBABczPcZ8AuP8YoYogRgTO +DG/7AhIBNh0Hb/sIyuB48cDhxc9xgAAcD0iBUSIAgCjyhiD/Ac9ygABQcEO4CmIA24DiyiHBD8oi +wQfKIGEByiOBDwAAbADKJMEA8AJh+solIQCB4s9wqgAMUL6Bx/eAvb6hAdkloATwoL2+oWWgtQZP ++/HAMg5P+xpwz3eAADhOEI+GIP8BQijRAM92oAC0Ryp1BfDSDm/7iiCIA3EWAJYEIIAPDgAAAEEo +foT19UMWAJZGIAANQx4YkFcWAJa8uL+4Vx4YkF8WAJa/uF8eGJAA2J64Ux4YkBCPYB4YkMz/z3CA +ADCMB4iA4BTyEI+GIP8Bkggv/kO4z3eAABwFFI8QdQjyz3CAAGhWFoBAeBQfQhQiDYAIQxYAlkwg +wKBFIAANQx4YkIAADQAKcDMmAHCAANRzQCeBchR5AHkQvZu9z3CAAKy0AIifvYDgAdjAeA+4pXhf +HhiQIPDPcIAArLQAiBC9gOAB2MB4D7iYuJ+4pXhFIMABXx4YkA7wEL3PcIAArLQAiJ+9gOAB2MB4 +D7ileF8eGJAKyITgdA5h+sogYQRhBU/7CiHAD+tyBdiKIw4KSiQAAIUBb/oKJQAB8cDuDG/7AdnP +cIAAHA8IgMC4G3gA3s91oAC0R0sdmJN3HViQz3GgAIRE2KEC2XcdWJAA2Z65Ux1YkFQdWJDPcYAA +OAFHHViQjrjPcYAAKABFIAYNSB1YkM9wgAAcD0kdmJMakAK4bLhEHRiQHNhFHRiQz3CAAFxjAYhG +HRiQz3CAADhOEIhz/0okwHDPcYAAhKrJcqgggAPPcIAA1LRWeGGA8mr2fz9nAoBipwHiA6fPd4AA +HAUAh4DgBPJkHRiQQx2YkQHYfP/PcIAAHA8ogOu5EfLPcIAA3AMQeEkdGJDPcABEFABLHRiQTB2Y +kwPYBPBLHZiTAdh3HRiQUSEAgECHDvJTIkEAErlEIgADDrgleIYi/wMKukV4EvBIcIYg8w8KuAQi +gQ8AAAAMBrkleAQigQ8AAAAwArkleM9xgADsYhUEb/sCoaHB8cCOC2/7mHCmwQQgg48AAAAET8EG +8s9wgABYBSCAz3CAANS0AIBAwQhyhiL+AyS6QCqNAw/CwrgOuKZ6BSCGADwcgDEEJoAPAQAAwC64 +QCgNBpy9z3KAABwPSIKfvc93gAAcBVEiAIDPcoAAWEQWegby0ILEp1GCBfDAgkGCxKdRJICBQ6cI +2gvyC9oEJr6PAAAAGMoigg8AAA8EUSQAgTpyzyXiFgX0USQAgs8lYhdRJkCCQfKA48ohwg/KIsIH +yiBiAcojgg8AAG4BaAci+solggEEIYEPAQAAwC65z3KAAFBwLmJJJo4QYb7PcYAAHA9iEYEAL8MI +uFJuVHpkecdygAAMqUgSDwZJEhIGRCEEAUAsQQIleGV4BCaBDwAAABAFIRMAnr0Y5s9+A8i5GIID +dPCA4xXyUSEAgkTBJMEQ8s9wgAAAcChggeDK9oLgBfQG2GDABfAH2GDAA/BgwQDA6Lge8kTAJMKg +4sohggDKISEABCCDDwEAAMDPdoAAAHBKZgQggA8GAAAAMbguuxpiz3CAAFBwaGBCeBPwUyDBAM9y +gAAwcz15KWIEIIAPAQAAwC64z3KAAFBwCGJhuBYhBQBMJQCGjPcKIcAP63IF2IojRgNdBi/6iiSD +D1EmAIIB2AfyL8HPcIAAAHAoYEAtggBUesdygAAMqeCCYbgEJoEP7wAA3Sa5JXhSINMDA8gEEhIA +uRhCAc9xgABMQRqBO4EkeFEgAIIG8iKCz3CnAIhJL6A8FBAwanCGIOMPz3agALRHQSgUAgXwEgpv ++4ogiANxFgCWBCCADw4AAABBKH6E9fWKIP8Pbx4YkGseGJAD2Q+5z3CgAMgfExhYgFkemJRaHtiT +Wx7YlFgeWJT7vUolAAAK8h6AArhCIIUDSCUFAKhwybgFfc9wgADUtAeAANkPIQEFJHjPcYAAzASA +4AHYQIHAeFMiAYCvvQfyhiJ/D116D7pFfQTwgODPJeITVx5Yk4DhB/SA4AbYyiDhAQLwANjPcYAA +HA8ogVEhAIAS8k8gAQKNuZe5FR5YkAUggQ+AAEA6Gh5YkAUggA+AAMBTEvAFIIEPgADAJBUeWJAF +IIEPgAAAPhoeWJAFIIAPgACAVxceGJDPcIAAMIwEkIHgDvSEFgGWUCEAAwQhgQ8AAAAMrbgCuSV4 +BPCEFgCWFh4YkIwlz4/KIcYPyiLGB8ogZgHKI4YPAAAKAaQEJvrKJMYA6XACDqAICnEI3EcAb/um +wKHB8cDmDy/7mHDPcIAA1LRggKTBaHCGIP4DJLgOuAZ5wrsOu2V5TcEEIYMPAQAAwC67geIB2MB4 +BrhWIEAIQCsNBpy9z3KAABwPSIKfvc92gAAcBVEiAIDPcoAAWER2egXy8ILkplGCBPDggkGC5Kbp +uUOmLvIEIYIPAQAAwC66z3aAAFBwSmZJIoIAYbrPdoAAHA9iFo4QLccCulR6x3KAAAyp5H5IEhEG +SRISBoYm/x4Jvgi7xXtlfwQhgQ8AAAAQJX+evU8gFAFPJNQhX/BRJECCzyBiAc8gIQHouZpwIfJD +wSPDoOPKIMIAyiAhAM92gAAAcGtmBCGPDwYAAAAxvwQhgg8BAADA+2Muus93gABQcEpnYnoWIIUA +LcALZhXwUyHAAM9ygAAwcx14CGIEIYIPAQAAwC66z3OAAFBwSmNhuhYghQAB20wlAIaM9wohwA/r +cgXYiiOJCTEDL/qKJIMPQC2CAFR6x3KAAAypABIRAAQSEgBhuwQhgQ/vAADdJrlleVIhzwPPcYAA +TEEagTuBJHhRIACCB/Iigs9wpwCISS+gNBQQMOlwhiDjD892oAC0R0EoEwIG8PoOL/uKIIgDcRYA +lgQggA8OAAAAQSh+hPT1iiD/D28eGJBrHhiQA9kPuc9woADIHxMYWIBZHpiUWh5YlFse2JNYHhiV ++71KJQAAC/IegAK4QiCFA0glBQCocMm4BX0A2c9wgADUtAeADyHBBAR5z3CAAMwEgOEB2UCAwHlT +IgCAr70I8oYifw9deg+6RX0F8IDhzyXiE1ceWJOA4Ab0gOEG2Mog4QED8ADYz3GAABwPKIFRIQCA *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 18:39:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 72D97106564A; Fri, 30 Apr 2010 18:39:08 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 48F6F8FC0C; Fri, 30 Apr 2010 18:39: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 o3UId8Ln047673; Fri, 30 Apr 2010 18:39:08 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UId8EL047672; Fri, 30 Apr 2010 18:39:08 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201004301839.o3UId8EL047672@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 30 Apr 2010 18:39:08 +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: r207444 - stable/8/sys/contrib/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 18:39:08 -0000 Author: bschmidt Date: Fri Apr 30 18:39:07 2010 New Revision: 207444 URL: http://svn.freebsd.org/changeset/base/207444 Log: Remove 2 empty files, leftovers from previous MFCs. Approved by: rpaulo (mentor) Deleted: stable/8/sys/contrib/dev/iwn/iwlwifi-4965-228.57.2.23.fw.uu stable/8/sys/contrib/dev/iwn/iwlwifi-5000-5.4.A.11.fw.uu From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 18:58:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77837106567A; Fri, 30 Apr 2010 18:58:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF0F8FC22; Fri, 30 Apr 2010 18:58: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 o3UIwtqS052045; Fri, 30 Apr 2010 18:58:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UIwtLW052042; Fri, 30 Apr 2010 18:58:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004301858.o3UIwtLW052042@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 30 Apr 2010 18:58: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: r207445 - head/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 18:58:55 -0000 Author: yongari Date: Fri Apr 30 18:58:55 2010 New Revision: 207445 URL: http://svn.freebsd.org/changeset/base/207445 Log: Add basic support for Marvell 88E8059 Yukon Optima. Tested by: James LaLagna < jameslalagna <> gmail dot com > MFC after: 5 days Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Apr 30 18:39:07 2010 (r207444) +++ head/sys/dev/msk/if_msk.c Fri Apr 30 18:58:55 2010 (r207445) @@ -223,6 +223,8 @@ static struct msk_product { "Marvell Yukon 88E8072 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4380, "Marvell Yukon 88E8057 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_4381, + "Marvell Yukon 88E8059 Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE550SX, "D-Link 550SX Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE560SX, @@ -239,7 +241,9 @@ static const char *model_name[] = { "Yukon FE", "Yukon FE+", "Yukon Supreme", - "Yukon Ultra 2" + "Yukon Ultra 2", + "Yukon Unknown", + "Yukon Optima", }; static int mskc_probe(device_t); @@ -1229,6 +1233,7 @@ msk_phy_power(struct msk_softc *sc, int case CHIP_ID_YUKON_EX: case CHIP_ID_YUKON_FE_P: case CHIP_ID_YUKON_UL_2: + case CHIP_ID_YUKON_OPT: CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); /* Enable all clocks. */ @@ -1372,6 +1377,10 @@ mskc_reset(struct msk_softc *sc) GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | GMC_BYP_RETR_ON); } + if (sc->msk_hw_id == CHIP_ID_YUKON_OPT && sc->msk_hw_rev == 0) { + /* Disable PCIe PHY powerdown(reg 0x80, bit7). */ + CSR_WRITE_4(sc, Y2_PEX_PHY_DATA, (0x0080 << 16) | 0x0080); + } CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_OFF); /* LED On. */ @@ -1705,8 +1714,9 @@ mskc_attach(device_t dev) sc->msk_hw_rev = (CSR_READ_1(sc, B2_MAC_CFG) >> 4) & 0x0f; /* Bail out if chip is not recognized. */ if (sc->msk_hw_id < CHIP_ID_YUKON_XL || - sc->msk_hw_id > CHIP_ID_YUKON_UL_2 || - sc->msk_hw_id == CHIP_ID_YUKON_SUPR) { + sc->msk_hw_id > CHIP_ID_YUKON_OPT || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR || + sc->msk_hw_id == CHIP_ID_YUKON_UNKNOWN) { device_printf(dev, "unknown device: id=0x%02x, rev=0x%02x\n", sc->msk_hw_id, sc->msk_hw_rev); mtx_destroy(&sc->msk_mtx); @@ -1819,6 +1829,10 @@ mskc_attach(device_t dev) sc->msk_clock = 125; /* 125 MHz */ sc->msk_pflags |= MSK_FLAG_JUMBO; break; + case CHIP_ID_YUKON_OPT: + sc->msk_clock = 125; /* 125 MHz */ + sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2; + break; default: sc->msk_clock = 156; /* 156 MHz */ break; Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Fri Apr 30 18:39:07 2010 (r207444) +++ head/sys/dev/msk/if_mskreg.h Fri Apr 30 18:58:55 2010 (r207445) @@ -145,6 +145,7 @@ #define DEVICEID_MRVL_436B 0x436B #define DEVICEID_MRVL_436C 0x436C #define DEVICEID_MRVL_4380 0x4380 +#define DEVICEID_MRVL_4381 0x4381 /* * D-Link gigabit ethernet device ID @@ -828,6 +829,9 @@ #define Y2_IS_CHK_RX2 BIT_10 /* Descriptor error Rx 2 */ #define Y2_IS_CHK_TXS2 BIT_9 /* Descriptor error TXS 2 */ #define Y2_IS_CHK_TXA2 BIT_8 /* Descriptor error TXA 2 */ +#define Y2_IS_PSM_ACK BIT_7 /* PSM Ack (Yukon Optima) */ +#define Y2_IS_PTP_TIST BIT_6 /* PTP TIme Stamp (Yukon Optima) */ +#define Y2_IS_PHY_QLNK BIT_5 /* PHY Quick Link (Yukon Optima) */ #define Y2_IS_IRQ_PHY1 BIT_4 /* Interrupt from PHY 1 */ #define Y2_IS_IRQ_MAC1 BIT_3 /* Interrupt from MAC 1 */ #define Y2_IS_CHK_RX1 BIT_2 /* Descriptor error Rx 1 */ @@ -894,6 +898,8 @@ #define CHIP_ID_YUKON_FE_P 0xb8 /* Chip ID for YUKON-2 FE+ */ #define CHIP_ID_YUKON_SUPR 0xb9 /* Chip ID for YUKON-2 Supreme */ #define CHIP_ID_YUKON_UL_2 0xba /* Chip ID for YUKON-2 Ultra 2 */ +#define CHIP_ID_YUKON_UNKNOWN 0xbb +#define CHIP_ID_YUKON_OPT 0xbc /* Chip ID for YUKON-2 Optima */ #define CHIP_REV_YU_XL_A0 0 /* Chip Rev. for Yukon-2 A0 */ #define CHIP_REV_YU_XL_A1 1 /* Chip Rev. for Yukon-2 A1 */ From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 19:01:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07667106566C; Fri, 30 Apr 2010 19:01:56 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id EB8358FC16; Fri, 30 Apr 2010 19:01: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 o3UJ1tP9052771; Fri, 30 Apr 2010 19:01:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UJ1thS052768; Fri, 30 Apr 2010 19:01:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004301901.o3UJ1thS052768@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 30 Apr 2010 19:01: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: r207446 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 19:01:56 -0000 Author: yongari Date: Fri Apr 30 19:01:55 2010 New Revision: 207446 URL: http://svn.freebsd.org/changeset/base/207446 Log: Add Marvell PHYG65G Gigabit PHY which is found on 88E8059 Yukon Optima. Tested by: James LaLagna < jameslalagna <> gmail dot com > MFC after: 5 days Modified: head/sys/dev/mii/e1000phy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Fri Apr 30 18:58:55 2010 (r207445) +++ head/sys/dev/mii/e1000phy.c Fri Apr 30 19:01:55 2010 (r207446) @@ -112,6 +112,7 @@ static const struct mii_phydesc e1000phy MII_PHY_DESC(MARVELL, E1116R), MII_PHY_DESC(MARVELL, E1118), MII_PHY_DESC(MARVELL, E3016), + MII_PHY_DESC(MARVELL, PHYG65G), MII_PHY_DESC(xxMARVELL, E1000), MII_PHY_DESC(xxMARVELL, E1011), MII_PHY_DESC(xxMARVELL, E1000_3), @@ -230,6 +231,7 @@ e1000phy_reset(struct mii_softc *sc) case MII_MODEL_MARVELL_E1116: case MII_MODEL_MARVELL_E1118: case MII_MODEL_MARVELL_E1149: + case MII_MODEL_MARVELL_PHYG65G: /* Disable energy detect mode. */ reg &= ~E1000_SCR_EN_DETECT_MASK; reg |= E1000_SCR_AUTO_X_MODE; Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Fri Apr 30 18:58:55 2010 (r207445) +++ head/sys/dev/mii/miidevs Fri Apr 30 19:01:55 2010 (r207446) @@ -247,6 +247,7 @@ model MARVELL E1116 0x0021 Marvell 88E1 model MARVELL E1116R 0x0024 Marvell 88E1116R Gigabit PHY model MARVELL E1118 0x0022 Marvell 88E1118 Gigabit PHY model MARVELL E3016 0x0026 Marvell 88E3016 10/100 Fast Ethernet PHY +model MARVELL PHYG65G 0x0027 Marvell PHYG65G Gigabit PHY model xxMARVELL E1000 0x0005 Marvell 88E1000 Gigabit PHY model xxMARVELL E1011 0x0002 Marvell 88E1011 Gigabit PHY model xxMARVELL E1000_3 0x0003 Marvell 88E1000 Gigabit PHY From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 19:05:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD6D81065672; Fri, 30 Apr 2010 19:05:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id CD4098FC29; Fri, 30 Apr 2010 19:05: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 o3UJ51Jx053498; Fri, 30 Apr 2010 19:05:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UJ51gj053496; Fri, 30 Apr 2010 19:05:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201004301905.o3UJ51gj053496@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 30 Apr 2010 19:05: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: r207447 - 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, 30 Apr 2010 19:05:02 -0000 Author: yongari Date: Fri Apr 30 19:05:01 2010 New Revision: 207447 URL: http://svn.freebsd.org/changeset/base/207447 Log: Marvell 88E8059(Yukon Optima) is now supported. Modified: head/share/man/man4/msk.4 Modified: head/share/man/man4/msk.4 ============================================================================== --- head/share/man/man4/msk.4 Fri Apr 30 19:01:55 2010 (r207446) +++ head/share/man/man4/msk.4 Fri Apr 30 19:05:01 2010 (r207447) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2010 +.Dd April 30, 2010 .Dt MSK 4 .Os .Sh NAME @@ -208,6 +208,8 @@ Marvell Yukon 88E8057 Gigabit Ethernet .It Marvell Yukon 88E8058 Gigabit Ethernet .It +Marvell Yukon 88E8059 Gigabit Ethernet +.It Marvell Yukon 88E8070 Gigabit Ethernet .It Marvell Yukon 88E8071 Gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 19:40:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79617106566C; Fri, 30 Apr 2010 19:40:37 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 69E288FC1B; Fri, 30 Apr 2010 19:40: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 o3UJeb5g061240; Fri, 30 Apr 2010 19:40:37 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UJebXR061238; Fri, 30 Apr 2010 19:40:37 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004301940.o3UJebXR061238@svn.freebsd.org> From: Kip Macy Date: Fri, 30 Apr 2010 19:40: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: r207448 - 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, 30 Apr 2010 19:40:37 -0000 Author: kmacy Date: Fri Apr 30 19:40:37 2010 New Revision: 207448 URL: http://svn.freebsd.org/changeset/base/207448 Log: - don't check hold_count without the page lock held - don't leak the page lock if m->object is NULL (assuming that that check will in fact even be valid when m->object is protected by the page lock) Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Apr 30 19:05:01 2010 (r207447) +++ head/sys/vm/vm_pageout.c Fri Apr 30 19:40:37 2010 (r207448) @@ -775,16 +775,17 @@ rescan0: if (m->flags & PG_MARKER) continue; - /* - * A held page may be undergoing I/O, so skip it. - */ - if (m->hold_count) { - vm_page_requeue(m); + if (!vm_page_trylock(m)) { addl_page_shortage++; continue; } - if (!vm_page_trylock(m) || (object = m->object) == NULL) { + /* + * A held page may be undergoing I/O, so skip it. + */ + if (m->hold_count || (object = m->object) == NULL) { + vm_page_unlock(m); + vm_page_requeue(m); addl_page_shortage++; continue; } From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 19:52:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 247F11065670; Fri, 30 Apr 2010 19:52:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 13C0E8FC13; Fri, 30 Apr 2010 19:52:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3UJqZ76063924; Fri, 30 Apr 2010 19:52:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UJqZ2m063917; Fri, 30 Apr 2010 19:52:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201004301952.o3UJqZ2m063917@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 30 Apr 2010 19:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207449 - head/contrib/telnet/telnet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 19:52:36 -0000 Author: jilles Date: Fri Apr 30 19:52:35 2010 New Revision: 207449 URL: http://svn.freebsd.org/changeset/base/207449 Log: telnet: Fix infinite loop if local output generates SIGPIPE. Instead of catching SIGPIPE and jumping out of the signal handler with longjmp, ignore it and handle write errors to the local output by exiting from there. I have changed the error message to mention the local output instead of NetBSD's wrong "Connection closed by foreign host". Write errors to the network were already handled by exiting immediately and this now applies to EPIPE too. The code assumed that SIGPIPE could only be generated by the network connection; if it was generated by the local output, it would longjmp out of the signal handler and write an error message which caused another SIGPIPE. PR: 19773 Obtained from: NetBSD MFC after: 1 week Modified: head/contrib/telnet/telnet/commands.c head/contrib/telnet/telnet/externs.h head/contrib/telnet/telnet/network.c head/contrib/telnet/telnet/sys_bsd.c head/contrib/telnet/telnet/telnet.c head/contrib/telnet/telnet/terminal.c Modified: head/contrib/telnet/telnet/commands.c ============================================================================== --- head/contrib/telnet/telnet/commands.c Fri Apr 30 19:40:37 2010 (r207448) +++ head/contrib/telnet/telnet/commands.c Fri Apr 30 19:52:35 2010 (r207449) @@ -2491,8 +2491,7 @@ tn(int argc, char *argv[]) env_export("USER"); } (void) call(status, "status", "notmuch", 0); - if (setjmp(peerdied) == 0) - telnet(user); + telnet(user); (void) NetClose(net); ExitString("Connection closed by foreign host.\n",1); /*NOTREACHED*/ Modified: head/contrib/telnet/telnet/externs.h ============================================================================== --- head/contrib/telnet/telnet/externs.h Fri Apr 30 19:40:37 2010 (r207448) +++ head/contrib/telnet/telnet/externs.h Fri Apr 30 19:52:35 2010 (r207449) @@ -233,7 +233,6 @@ extern void SetNetTrace(char *); /* Function to change where debugging goes */ extern jmp_buf - peerdied, toplevel; /* For error conditions. */ extern void Modified: head/contrib/telnet/telnet/network.c ============================================================================== --- head/contrib/telnet/telnet/network.c Fri Apr 30 19:40:37 2010 (r207448) +++ head/contrib/telnet/telnet/network.c Fri Apr 30 19:52:35 2010 (r207449) @@ -158,7 +158,7 @@ netflush(void) perror(hostname); (void)NetClose(net); ring_clear_mark(&netoring); - longjmp(peerdied, -1); + ExitString("Connection closed by foreign host.\n", 1); /*NOTREACHED*/ } n = 0; Modified: head/contrib/telnet/telnet/sys_bsd.c ============================================================================== --- head/contrib/telnet/telnet/sys_bsd.c Fri Apr 30 19:40:37 2010 (r207448) +++ head/contrib/telnet/telnet/sys_bsd.c Fri Apr 30 19:52:35 2010 (r207449) @@ -809,14 +809,6 @@ NetNonblockingIO(int fd, int onoff) */ /* ARGSUSED */ -static SIG_FUNC_RET -deadpeer(int sig __unused) -{ - setcommandmode(); - longjmp(peerdied, -1); -} - -/* ARGSUSED */ SIG_FUNC_RET intr(int sig __unused) { @@ -884,7 +876,7 @@ sys_telnet_init(void) { (void) signal(SIGINT, intr); (void) signal(SIGQUIT, intr2); - (void) signal(SIGPIPE, deadpeer); + (void) signal(SIGPIPE, SIG_IGN); #ifdef SIGWINCH (void) signal(SIGWINCH, sendwin); #endif Modified: head/contrib/telnet/telnet/telnet.c ============================================================================== --- head/contrib/telnet/telnet/telnet.c Fri Apr 30 19:40:37 2010 (r207448) +++ head/contrib/telnet/telnet/telnet.c Fri Apr 30 19:52:35 2010 (r207449) @@ -146,7 +146,6 @@ unsigned char telopt_environ = TELOPT_NE #endif jmp_buf toplevel; -jmp_buf peerdied; int flushline; int linemode; Modified: head/contrib/telnet/telnet/terminal.c ============================================================================== --- head/contrib/telnet/telnet/terminal.c Fri Apr 30 19:40:37 2010 (r207448) +++ head/contrib/telnet/telnet/terminal.c Fri Apr 30 19:52:35 2010 (r207449) @@ -111,7 +111,8 @@ init_terminal(void) } /* - * Send as much data as possible to the terminal. + * Send as much data as possible to the terminal, else exits if + * it encounters a permanent failure when writing to the tty. * * Return value: * -1: No useful work done, data waiting to go out. @@ -152,8 +153,19 @@ ttyflush(int drop) } ring_consumed(&ttyoring, n); } - if (n < 0) + if (n < 0) { + if (errno == EAGAIN || errno == EINTR) { + return -1; + } else { + ring_consumed(&ttyoring, ring_full_count(&ttyoring)); + setconnmode(0); + setcommandmode(); + NetClose(net); + fprintf(stderr, "Write error on local output.\n"); + exit(1); + } return -1; + } if (n == n0) { if (n0) return -1; From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 20:13:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2314C1065679; Fri, 30 Apr 2010 20:13:52 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-yw0-f183.google.com (mail-yw0-f183.google.com [209.85.211.183]) by mx1.freebsd.org (Postfix) with ESMTP id 8E1A88FC2B; Fri, 30 Apr 2010 20:13:51 +0000 (UTC) Received: by ywh13 with SMTP id 13so269678ywh.8 for ; Fri, 30 Apr 2010 13:13:43 -0700 (PDT) Received: by 10.91.39.4 with SMTP id r4mr730047agj.107.1272658423265; Fri, 30 Apr 2010 13:13:43 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.90.78.2 with HTTP; Fri, 30 Apr 2010 13:13:23 -0700 (PDT) In-Reply-To: <201004301712.o3UHCKvd028285@svn.freebsd.org> References: <201004301712.o3UHCKvd028285@svn.freebsd.org> From: Juli Mallett Date: Fri, 30 Apr 2010 13:13:23 -0700 X-Google-Sender-Auth: c86deca64f35488c Message-ID: To: Randall Stewart Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207441 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 20:13:52 -0000 On Fri, Apr 30, 2010 at 10:12, Randall Stewart wrote: > Author: rrs > Date: Fri Apr 30 17:12:20 2010 > New Revision: 207441 > URL: http://svn.freebsd.org/changeset/base/207441 > > Log: > =A0Bug in the memory mapping module. The wrong > =A0physaddr was being used in the macro (1 should be > =A0used not 2)... > > =A0Obtained from: =A0 =A0 =A0 =A0JC Thanks! From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 21:20:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1181D106564A; Fri, 30 Apr 2010 21:20:15 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 01A098FC0A; Fri, 30 Apr 2010 21:20: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 o3ULKEHR083170; Fri, 30 Apr 2010 21:20:14 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ULKEar083168; Fri, 30 Apr 2010 21:20:14 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004302120.o3ULKEar083168@svn.freebsd.org> From: Kip Macy Date: Fri, 30 Apr 2010 21:20: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: r207450 - 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, 30 Apr 2010 21:20:15 -0000 Author: kmacy Date: Fri Apr 30 21:20:14 2010 New Revision: 207450 URL: http://svn.freebsd.org/changeset/base/207450 Log: - acquire the page lock in vm_contig_launder_page before checking page fields - release page queue lock before calling vm_pageout_flush Modified: head/sys/vm/vm_contig.c Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Fri Apr 30 19:52:35 2010 (r207449) +++ head/sys/vm/vm_contig.c Fri Apr 30 21:20:14 2010 (r207450) @@ -96,30 +96,33 @@ vm_contig_launder_page(vm_page_t m, vm_p vm_page_t m_tmp; struct vnode *vp; struct mount *mp; - int vfslocked; + int vfslocked, dirty; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock(m); + vm_page_lock_queues(); object = m->object; if (!VM_OBJECT_TRYLOCK(object) && !vm_pageout_fallback_object_lock(m, next)) { VM_OBJECT_UNLOCK(object); + vm_page_unlock_queues(); + vm_page_unlock(m); return (EAGAIN); } if (vm_page_sleep_if_busy(m, TRUE, "vpctw0")) { VM_OBJECT_UNLOCK(object); - vm_page_lock_queues(); return (EBUSY); } vm_page_test_dirty(m); if (m->dirty == 0 && m->hold_count == 0) pmap_remove_all(m); - if (m->dirty) { + if ((dirty = m->dirty) != 0) { + vm_page_unlock_queues(); + vm_page_unlock(m); if ((object->flags & OBJ_DEAD) != 0) { VM_OBJECT_UNLOCK(object); return (EAGAIN); } if (object->type == OBJT_VNODE) { - vm_page_unlock_queues(); vp = object->handle; vm_object_reference_locked(object); VM_OBJECT_UNLOCK(object); @@ -133,7 +136,6 @@ vm_contig_launder_page(vm_page_t m, vm_p VFS_UNLOCK_GIANT(vfslocked); vm_object_deallocate(object); vn_finished_write(mp); - vm_page_lock_queues(); return (0); } else if (object->type == OBJT_SWAP || object->type == OBJT_DEFAULT) { @@ -144,6 +146,11 @@ vm_contig_launder_page(vm_page_t m, vm_p } } else if (m->hold_count == 0) vm_page_cache(m); + + if (dirty == 0) { + vm_page_unlock_queues(); + vm_page_unlock(m); + } VM_OBJECT_UNLOCK(object); return (0); } @@ -162,7 +169,9 @@ vm_contig_launder(int queue) KASSERT(VM_PAGE_INQUEUE2(m, queue), ("vm_contig_launder: page %p's queue is not %d", m, queue)); + vm_page_unlock_queues(); error = vm_contig_launder_page(m, &next); + vm_page_lock_queues(); if (error == 0) return (TRUE); if (error == EBUSY) From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 21:21:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A493B106564A; Fri, 30 Apr 2010 21:21:21 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 94BC28FC21; Fri, 30 Apr 2010 21:21:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3ULLLkg083467; Fri, 30 Apr 2010 21:21:21 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3ULLL9I083465; Fri, 30 Apr 2010 21:21:21 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004302121.o3ULLL9I083465@svn.freebsd.org> From: Kip Macy Date: Fri, 30 Apr 2010 21:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207451 - 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, 30 Apr 2010 21:21:21 -0000 Author: kmacy Date: Fri Apr 30 21:21:21 2010 New Revision: 207451 URL: http://svn.freebsd.org/changeset/base/207451 Log: don't call vm_pageout_flush with the page queue mutex held Reported by: Michael Butler Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Apr 30 21:20:14 2010 (r207450) +++ head/sys/vm/vm_object.c Fri Apr 30 21:21:21 2010 (r207451) @@ -1058,7 +1058,9 @@ vm_object_page_collect_flush(vm_object_t } runlen = maxb + maxf + 1; + vm_page_unlock_queues(); vm_pageout_flush(ma, runlen, pagerflags); + vm_page_lock_queues(); for (i = 0; i < runlen; i++) { if (ma[i]->dirty) { vm_page_unlock_queues(); From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 22:31:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 25B3C1065670; Fri, 30 Apr 2010 22:31:38 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 153E88FC12; Fri, 30 Apr 2010 22:31:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3UMVb3J098817; Fri, 30 Apr 2010 22:31:37 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UMVbiY098814; Fri, 30 Apr 2010 22:31:37 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004302231.o3UMVbiY098814@svn.freebsd.org> From: Kip Macy Date: Fri, 30 Apr 2010 22:31: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: r207452 - 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, 30 Apr 2010 22:31:38 -0000 Author: kmacy Date: Fri Apr 30 22:31:37 2010 New Revision: 207452 URL: http://svn.freebsd.org/changeset/base/207452 Log: push up dropping of the page queue lock to avoid holding it in vm_pageout_flush Modified: head/sys/vm/vm_object.c head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Apr 30 21:21:21 2010 (r207451) +++ head/sys/vm/vm_object.c Fri Apr 30 22:31:37 2010 (r207452) @@ -774,6 +774,7 @@ vm_object_page_clean(vm_object_t object, int pagerflags; int curgeneration; + mtx_assert(&vm_page_queue_mtx, MA_NOTOWNED); VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); if ((object->flags & OBJ_MIGHTBEDIRTY) == 0) return; @@ -830,13 +831,13 @@ vm_object_page_clean(vm_object_t object, ++tscan; continue; } + vm_page_unlock_queues(); + vm_page_unlock(p); /* * If we have been asked to skip nosync pages and * this is a nosync page, we can't continue. */ if ((flags & OBJPC_NOSYNC) && (p->oflags & VPO_NOSYNC)) { - vm_page_unlock_queues(); - vm_page_unlock(p); if (--scanlimit == 0) break; ++tscan; @@ -849,8 +850,7 @@ vm_object_page_clean(vm_object_t object, * page (i.e. had to sleep). */ tscan += vm_object_page_collect_flush(object, p, curgeneration, pagerflags); - vm_page_unlock_queues(); - vm_page_unlock(p); + } /* @@ -860,7 +860,6 @@ vm_object_page_clean(vm_object_t object, * return immediately. */ if (tscan >= tend && (tstart || tend < object->size)) { - vm_page_unlock_queues(); vm_object_clear_flag(object, OBJ_CLEANING); return; } @@ -918,43 +917,33 @@ again: p->oflags &= ~VPO_CLEANCHK; continue; } - + vm_page_unlock_queues(); + vm_page_unlock(p); /* * If we have been asked to skip nosync pages and this is a * nosync page, skip it. Note that the object flags were * not cleared in this case so we do not have to set them. */ if ((flags & OBJPC_NOSYNC) && (p->oflags & VPO_NOSYNC)) { - vm_page_unlock_queues(); - vm_page_unlock(p); p->oflags &= ~VPO_CLEANCHK; continue; } n = vm_object_page_collect_flush(object, p, curgeneration, pagerflags); - if (n == 0) { - vm_page_unlock_queues(); - vm_page_unlock(p); + if (n == 0) goto rescan; - } - if (object->generation != curgeneration) { - vm_page_unlock_queues(); - vm_page_unlock(p); + if (object->generation != curgeneration) goto rescan; - } /* * Try to optimize the next page. If we can't we pick up * our (random) scan where we left off. */ - if (msync_flush_flags & MSYNC_FLUSH_SOFTSEQ) { - vm_page_unlock_queues(); - vm_page_unlock(p); + if (msync_flush_flags & MSYNC_FLUSH_SOFTSEQ) if ((p = vm_page_lookup(object, pi + n)) != NULL) goto again; - } } #if 0 VOP_FSYNC(vp, (pagerflags & VM_PAGER_PUT_SYNC)?MNT_WAIT:0, curproc); @@ -977,12 +966,11 @@ vm_object_page_collect_flush(vm_object_t vm_page_t mab[vm_pageout_page_count]; vm_page_t ma[vm_pageout_page_count]; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - vm_page_lock_assert(p, MA_OWNED); + mtx_assert(&vm_page_queue_mtx, MA_NOTOWNED); + vm_page_lock_assert(p, MA_NOTOWNED); + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); pi = p->pindex; while (vm_page_sleep_if_busy(p, TRUE, "vpcwai")) { - vm_page_lock(p); - vm_page_lock_queues(); if (object->generation != curgeneration) { return(0); } @@ -997,16 +985,17 @@ vm_object_page_collect_flush(vm_object_t (tp->oflags & VPO_CLEANCHK) == 0) || (tp->busy != 0)) break; - vm_page_unlock_queues(); vm_page_lock(tp); vm_page_lock_queues(); vm_page_test_dirty(tp); if (tp->dirty == 0) { vm_page_unlock(tp); + vm_page_unlock_queues(); tp->oflags &= ~VPO_CLEANCHK; break; } vm_page_unlock(tp); + vm_page_unlock_queues(); maf[ i - 1 ] = tp; maxf++; continue; @@ -1026,15 +1015,16 @@ vm_object_page_collect_flush(vm_object_t (tp->oflags & VPO_CLEANCHK) == 0) || (tp->busy != 0)) break; - vm_page_unlock_queues(); vm_page_lock(tp); vm_page_lock_queues(); vm_page_test_dirty(tp); if (tp->dirty == 0) { + vm_page_unlock_queues(); vm_page_unlock(tp); tp->oflags &= ~VPO_CLEANCHK; break; } + vm_page_unlock_queues(); vm_page_unlock(tp); mab[ i - 1 ] = tp; maxb++; @@ -1058,15 +1048,13 @@ vm_object_page_collect_flush(vm_object_t } runlen = maxb + maxf + 1; - vm_page_unlock_queues(); vm_pageout_flush(ma, runlen, pagerflags); - vm_page_lock_queues(); for (i = 0; i < runlen; i++) { if (ma[i]->dirty) { - vm_page_unlock_queues(); vm_page_lock(ma[i]); vm_page_lock_queues(); pmap_remove_write(ma[i]); + vm_page_unlock_queues(); vm_page_unlock(ma[i]); ma[i]->oflags |= VPO_CLEANCHK; Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Apr 30 21:21:21 2010 (r207451) +++ head/sys/vm/vm_pageout.c Fri Apr 30 22:31:37 2010 (r207452) @@ -433,6 +433,8 @@ vm_pageout_flush(vm_page_t *mc, int coun int i; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + mtx_assert(&vm_page_queue_mtx, MA_NOTOWNED); + /* * Initiate I/O. Bump the vm_page_t->busy counter and * mark the pages read-only. From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 22:33:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82572106566C; Fri, 30 Apr 2010 22:33:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 723BA8FC16; Fri, 30 Apr 2010 22:33: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 o3UMXnOW099320; Fri, 30 Apr 2010 22:33:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3UMXnW6099318; Fri, 30 Apr 2010 22:33:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201004302233.o3UMXnW6099318@svn.freebsd.org> From: Ed Schouten Date: Fri, 30 Apr 2010 22:33: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: r207453 - head/usr.bin/script X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 22:33:49 -0000 Author: ed Date: Fri Apr 30 22:33:49 2010 New Revision: 207453 URL: http://svn.freebsd.org/changeset/base/207453 Log: Remove WNOHANG flag from wait3(). Because script(1) now reliably terminates when the TTY is closed, it may be the case that the call to wait3() occurs just before the child process exits. This causes error codes to be ignored. Just change script(1) to use waitpid() instead of wait3(). This makes it more portable and prevents the need for a loop, since waitpid() only returns a specified process. PR: bin/146189 Tested by: amdmi3@, older version MFC after: 2 weeks Modified: head/usr.bin/script/script.c Modified: head/usr.bin/script/script.c ============================================================================== --- head/usr.bin/script/script.c Fri Apr 30 22:31:37 2010 (r207452) +++ head/usr.bin/script/script.c Fri Apr 30 22:33:49 2010 (r207453) @@ -219,23 +219,17 @@ usage(void) void finish(void) { - pid_t pid; - int die, e, status; + int e, status; - die = e = 0; - while ((pid = wait3(&status, WNOHANG, 0)) > 0) - if (pid == child) { - die = 1; - if (WIFEXITED(status)) - e = WEXITSTATUS(status); - else if (WIFSIGNALED(status)) - e = WTERMSIG(status); - else /* can't happen */ - e = 1; - } - - if (die) + if (waitpid(child, &status, 0) == child) { + if (WIFEXITED(status)) + e = WEXITSTATUS(status); + else if (WIFSIGNALED(status)) + e = WTERMSIG(status); + else /* can't happen */ + e = 1; done(e); + } } void From owner-svn-src-all@FreeBSD.ORG Fri Apr 30 23:09:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 733D5106566B; Fri, 30 Apr 2010 23:09:17 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [92.53.116.15]) by mx1.freebsd.org (Postfix) with ESMTP id 2ACA68FC18; Fri, 30 Apr 2010 23:09:16 +0000 (UTC) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.71) (envelope-from ) id 1O7zKb-0005fl-KQ; Sat, 01 May 2010 03:09:13 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 0BFA8B856; Sat, 1 May 2010 03:09:10 +0400 (MSD) Received: by hades.panopticon (Postfix, from userid 1000) id 05DCAB829; Sat, 1 May 2010 03:09:10 +0400 (MSD) Date: Sat, 1 May 2010 03:09:10 +0400 From: Dmitry Marakasov To: Ed Schouten Message-ID: <20100430230910.GA99663@hades.panopticon> References: <201004302233.o3UMXnW6099318@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201004302233.o3UMXnW6099318@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207453 - head/usr.bin/script X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Apr 2010 23:09:17 -0000 * Ed Schouten (ed@FreeBSD.org) wrote: Thanks! -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru From owner-svn-src-all@FreeBSD.ORG Sat May 1 00:36:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D1F1106566C; Sat, 1 May 2010 00:36:41 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0D1178FC0C; Sat, 1 May 2010 00:36:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o410aekL026382; Sat, 1 May 2010 00:36:40 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o410aeGj026381; Sat, 1 May 2010 00:36:40 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201005010036.o410aeGj026381@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 1 May 2010 00:36: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: r207454 - head/sys/compat/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 00:36:41 -0000 Author: jkim Date: Sat May 1 00:36:40 2010 New Revision: 207454 URL: http://svn.freebsd.org/changeset/base/207454 Log: Do not initialize mutex and return error if it cannot map memory. Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Fri Apr 30 22:33:49 2010 (r207453) +++ head/sys/compat/x86bios/x86bios.c Sat May 1 00:36:40 2010 (r207454) @@ -563,15 +563,15 @@ x86bios_unmap_mem(void) contigfree(x86bios_seg, X86BIOS_SEG_SIZE, M_DEVBUF); } -static void -x86bios_init(void *arg __unused) +static int +x86bios_init(void) { int i; - mtx_init(&x86bios_lock, "x86bios lock", NULL, MTX_SPIN); - if (x86bios_map_mem() != 0) - return; + return (ENOMEM); + + mtx_init(&x86bios_lock, "x86bios lock", NULL, MTX_SPIN); x86bios_map = malloc(sizeof(*x86bios_map) * X86BIOS_PAGES, M_DEVBUF, M_WAITOK | M_ZERO); @@ -600,10 +600,12 @@ x86bios_init(void *arg __unused) for (i = 0; i < 256; i++) x86bios_emu._x86emu_intrTab[i] = x86bios_emu_get_intr; + + return (0); } -static void -x86bios_uninit(void *arg __unused) +static int +x86bios_uninit(void) { vm_offset_t *map = x86bios_map; @@ -618,6 +620,8 @@ x86bios_uninit(void *arg __unused) x86bios_unmap_mem(); mtx_destroy(&x86bios_lock); + + return (0); } static int @@ -626,16 +630,12 @@ x86bios_modevent(module_t mod __unused, switch (type) { case MOD_LOAD: - x86bios_init(NULL); - break; + return (x86bios_init()); case MOD_UNLOAD: - x86bios_uninit(NULL); - break; + return (x86bios_uninit()); default: return (ENOTSUP); } - - return (0); } static moduledata_t x86bios_mod = { From owner-svn-src-all@FreeBSD.ORG Sat May 1 00:50:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8793D1065670; Sat, 1 May 2010 00:50:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 74F278FC0C; Sat, 1 May 2010 00:50: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 o410opwm029521; Sat, 1 May 2010 00:50:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o410opxK029511; Sat, 1 May 2010 00:50:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201005010050.o410opxK029511@svn.freebsd.org> From: Rick Macklem Date: Sat, 1 May 2010 00:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207455 - in stable/8/sys/fs: nfs nfsclient nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 00:50:51 -0000 Author: rmacklem Date: Sat May 1 00:50:51 2010 New Revision: 207455 URL: http://svn.freebsd.org/changeset/base/207455 Log: MFC: r207170 An NFSv4 server will reply NFSERR_GRACE for non-recovery RPCs during the grace period after startup. This grace period must be at least the lease duration, which is typically 1-2 minutes. It seems prudent for the experimental NFS client to wait a few seconds before retrying such an RPC, so that the server isn't flooded with non-recovery RPCs during recovery. This patch adds an argument to nfs_catnap() to implement a 5 second delay for this case. Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c stable/8/sys/fs/nfs/nfs_commonport.c stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfs/nfsport.h stable/8/sys/fs/nfsclient/nfs_clrpcops.c stable/8/sys/fs/nfsclient/nfs_clstate.c stable/8/sys/fs/nfsclient/nfs_clvfsops.c stable/8/sys/fs/nfsclient/nfs_clvnops.c stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Sat May 1 00:36:40 2010 (r207454) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Sat May 1 00:50:51 2010 (r207455) @@ -650,7 +650,7 @@ tryagain: trylater_delay = NFS_TRYLATERDEL; waituntil = NFSD_MONOSEC + trylater_delay; while (NFSD_MONOSEC < waituntil) - (void) nfs_catnap(PZERO, "nfstry"); + (void) nfs_catnap(PZERO, 0, "nfstry"); trylater_delay *= 2; goto tryagain; } Modified: stable/8/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonport.c Sat May 1 00:36:40 2010 (r207454) +++ stable/8/sys/fs/nfs/nfs_commonport.c Sat May 1 00:50:51 2010 (r207455) @@ -345,17 +345,21 @@ newnfs_timer(void *arg) /* - * sleep for a short period of time. + * Sleep for a short period of time unless errval == NFSERR_GRACE, where + * the sleep should be for 5 seconds. * Since lbolt doesn't exist in FreeBSD-CURRENT, just use a timeout on * an event that never gets a wakeup. Only return EINTR or 0. */ int -nfs_catnap(int prio, const char *wmesg) +nfs_catnap(int prio, int errval, const char *wmesg) { static int non_event; int ret; - ret = tsleep(&non_event, prio, wmesg, 1); + if (errval == NFSERR_GRACE) + ret = tsleep(&non_event, prio, wmesg, 5 * hz); + else + ret = tsleep(&non_event, prio, wmesg, 1); if (ret != EINTR) ret = 0; return (ret); Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Sat May 1 00:36:40 2010 (r207454) +++ stable/8/sys/fs/nfs/nfs_var.h Sat May 1 00:50:51 2010 (r207455) @@ -322,7 +322,7 @@ int nfsvno_v4rootexport(struct nfsrv_des void newnfs_portinit(void); struct ucred *newnfs_getcred(void); void newnfs_setroot(struct ucred *); -int nfs_catnap(int, const char *); +int nfs_catnap(int, int, const char *); struct nfsreferral *nfsv4root_getreferral(vnode_t, vnode_t, u_int32_t); int nfsrv_atroot(vnode_t, long *); void newnfs_timer(void *); Modified: stable/8/sys/fs/nfs/nfsport.h ============================================================================== --- stable/8/sys/fs/nfs/nfsport.h Sat May 1 00:36:40 2010 (r207454) +++ stable/8/sys/fs/nfs/nfsport.h Sat May 1 00:50:51 2010 (r207455) @@ -147,21 +147,21 @@ #define NFSMGET(m) do { \ MGET((m), M_TRYWAIT, MT_DATA); \ while ((m) == NULL ) { \ - (void) nfs_catnap(PZERO, "nfsmget"); \ + (void) nfs_catnap(PZERO, 0, "nfsmget"); \ MGET((m), M_TRYWAIT, MT_DATA); \ } \ } while (0) #define NFSMGETHDR(m) do { \ MGETHDR((m), M_TRYWAIT, MT_DATA); \ while ((m) == NULL ) { \ - (void) nfs_catnap(PZERO, "nfsmget"); \ + (void) nfs_catnap(PZERO, 0, "nfsmget"); \ MGETHDR((m), M_TRYWAIT, MT_DATA); \ } \ } while (0) #define NFSMCLGET(m, w) do { \ MGET((m), M_TRYWAIT, MT_DATA); \ while ((m) == NULL ) { \ - (void) nfs_catnap(PZERO, "nfsmget"); \ + (void) nfs_catnap(PZERO, 0, "nfsmget"); \ MGET((m), M_TRYWAIT, MT_DATA); \ } \ MCLGET((m), (w)); \ @@ -169,7 +169,7 @@ #define NFSMCLGETHDR(m, w) do { \ MGETHDR((m), M_TRYWAIT, MT_DATA); \ while ((m) == NULL ) { \ - (void) nfs_catnap(PZERO, "nfsmget"); \ + (void) nfs_catnap(PZERO, 0, "nfsmget"); \ MGETHDR((m), M_TRYWAIT, MT_DATA); \ } \ } while (0) Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clrpcops.c Sat May 1 00:36:40 2010 (r207454) +++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c Sat May 1 00:50:51 2010 (r207455) @@ -300,7 +300,7 @@ else printf(" fhl=0\n"); nfscl_openrelease(op, error, newone); if (error == NFSERR_GRACE || error == NFSERR_STALECLIENTID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY) { - (void) nfs_catnap(PZERO, "nfs_open"); + (void) nfs_catnap(PZERO, error, "nfs_open"); } else if ((error == NFSERR_EXPIRED || error == NFSERR_BADSTATEID) && clidrev != 0) { expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); @@ -462,7 +462,7 @@ nfsrpc_openrpc(struct nfsmount *nmp, vno ret = nfsrpc_openconfirm(vp, newfhp, newfhlen, op, cred, p); if (ret == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfs_open"); + (void) nfs_catnap(PZERO, ret, "nfs_open"); } while (ret == NFSERR_DELAY); error = ret; } @@ -486,7 +486,7 @@ nfsrpc_openrpc(struct nfsmount *nmp, vno newfhlen, mode, op, name, namelen, &ndp, 0, 0x0, cred, p, syscred, 1); if (ret == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfs_open2"); + (void) nfs_catnap(PZERO, ret, "nfs_open2"); } while (ret == NFSERR_DELAY); if (ret) { if (ndp != NULL) @@ -626,6 +626,7 @@ nfsrpc_doclose(struct nfsmount *nmp, str nd->nd_repstat == NFSERR_DELAY) && error == 0) (void) nfs_catnap(PZERO, + (int)nd->nd_repstat, "nfs_close"); } while ((nd->nd_repstat == NFSERR_GRACE || nd->nd_repstat == NFSERR_DELAY) && @@ -647,7 +648,7 @@ nfsrpc_doclose(struct nfsmount *nmp, str do { error = nfscl_tryclose(op, tcred, nmp, p); if (error == NFSERR_GRACE) - (void) nfs_catnap(PZERO, "nfs_close"); + (void) nfs_catnap(PZERO, error, "nfs_close"); } while (error == NFSERR_GRACE); NFSLOCKCLSTATE(); nfscl_lockunlock(&op->nfso_own->nfsow_rwlock); @@ -1006,7 +1007,7 @@ nfsrpc_setattr(vnode_t vp, struct vattr if (error == NFSERR_GRACE || error == NFSERR_STALESTATEID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || error == NFSERR_OLDSTATEID) { - (void) nfs_catnap(PZERO, "nfs_setattr"); + (void) nfs_catnap(PZERO, error, "nfs_setattr"); } else if ((error == NFSERR_EXPIRED || error == NFSERR_BADSTATEID) && clidrev != 0) { expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); @@ -1251,7 +1252,7 @@ nfsrpc_read(vnode_t vp, struct uio *uiop if (error == NFSERR_GRACE || error == NFSERR_STALESTATEID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || error == NFSERR_OLDSTATEID) { - (void) nfs_catnap(PZERO, "nfs_read"); + (void) nfs_catnap(PZERO, error, "nfs_read"); } else if ((error == NFSERR_EXPIRED || error == NFSERR_BADSTATEID) && clidrev != 0) { expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); @@ -1416,7 +1417,7 @@ nfscl_dumpstate(nmp, 1, 1, 0, 0); if (error == NFSERR_GRACE || error == NFSERR_STALESTATEID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || error == NFSERR_OLDSTATEID) { - (void) nfs_catnap(PZERO, "nfs_write"); + (void) nfs_catnap(PZERO, error, "nfs_write"); } else if ((error == NFSERR_EXPIRED || error == NFSERR_BADSTATEID) && clidrev != 0) { expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); @@ -1743,7 +1744,7 @@ nfsrpc_create(vnode_t dvp, char *name, i nfscl_ownerrelease(owp, error, newone, unlocked); if (error == NFSERR_GRACE || error == NFSERR_STALECLIENTID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY) { - (void) nfs_catnap(PZERO, "nfs_open"); + (void) nfs_catnap(PZERO, error, "nfs_open"); } else if ((error == NFSERR_EXPIRED || error == NFSERR_BADSTATEID) && clidrev != 0) { expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); @@ -1976,7 +1977,7 @@ nfsrpc_createv4(vnode_t dvp, char *name, ret = nfsrpc_openconfirm(dvp, nfhp->nfh_fh, nfhp->nfh_len, op, cred, p); if (ret == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfs_create"); + (void) nfs_catnap(PZERO, ret, "nfs_create"); } while (ret == NFSERR_DELAY); error = ret; } @@ -1998,7 +1999,7 @@ nfsrpc_createv4(vnode_t dvp, char *name, (NFSV4OPEN_ACCESSWRITE | NFSV4OPEN_ACCESSREAD), op, name, namelen, &dp, 0, 0x0, cred, p, 0, 1); if (ret == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfs_crt2"); + (void) nfs_catnap(PZERO, ret, "nfs_crt2"); } while (ret == NFSERR_DELAY); if (ret) { if (dp != NULL) @@ -3540,7 +3541,8 @@ nfsrpc_advlock(vnode_t vp, off_t size, i if ((nd->nd_repstat == NFSERR_GRACE || nd->nd_repstat == NFSERR_DELAY) && error == 0) - (void) nfs_catnap(PZERO, "nfs_advlock"); + (void) nfs_catnap(PZERO, (int)nd->nd_repstat, + "nfs_advlock"); } while ((nd->nd_repstat == NFSERR_GRACE || nd->nd_repstat == NFSERR_DELAY) && error == 0); } @@ -3577,7 +3579,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, i if (error == NFSERR_GRACE || error == NFSERR_STALESTATEID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_STALECLIENTID || error == NFSERR_DELAY) { - (void) nfs_catnap(PZERO, "nfs_advlock"); + (void) nfs_catnap(PZERO, error, "nfs_advlock"); } else if ((error == NFSERR_EXPIRED || error == NFSERR_BADSTATEID) && clidrev != 0) { expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clstate.c Sat May 1 00:36:40 2010 (r207454) +++ stable/8/sys/fs/nfsclient/nfs_clstate.c Sat May 1 00:50:51 2010 (r207455) @@ -784,7 +784,7 @@ nfscl_getcl(vnode_t vp, struct ucred *cr if (error == NFSERR_STALECLIENTID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_CLIDINUSE) { - (void) nfs_catnap(PZERO, "nfs_setcl"); + (void) nfs_catnap(PZERO, error, "nfs_setcl"); } } while (((error == NFSERR_STALECLIENTID || error == NFSERR_STALEDONTRECOVER) && --trystalecnt > 0) || @@ -2046,7 +2046,7 @@ nfscl_recover(struct nfsclclient *clp, s newnfs_copycred(&op->nfso_cred, tcred); error = nfscl_tryclose(op, tcred, nmp, p); if (error == NFSERR_GRACE) - (void) nfs_catnap(PZERO, "nfsexcls"); + (void) nfs_catnap(PZERO, error, "nfsexcls"); } while (error == NFSERR_GRACE); LIST_REMOVE(op, nfso_list); FREE((caddr_t)op, M_NFSCLOPEN); @@ -2059,7 +2059,7 @@ nfscl_recover(struct nfsclclient *clp, s newnfs_copycred(&dp->nfsdl_cred, tcred); error = nfscl_trydelegreturn(dp, tcred, nmp, p); if (error == NFSERR_GRACE) - (void) nfs_catnap(PZERO, "nfsexdlg"); + (void) nfs_catnap(PZERO, error, "nfsexdlg"); } while (error == NFSERR_GRACE); TAILQ_REMOVE(&extra_deleg, dp, nfsdl_list); FREE((caddr_t)dp, M_NFSCLDELEG); @@ -3619,7 +3619,7 @@ nfscl_tryopen(struct nfsmount *nmp, vnod mode, op, name, namelen, ndpp, reclaim, delegtype, cred, p, 0, 0); if (error == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfstryop"); + (void) nfs_catnap(PZERO, error, "nfstryop"); } while (error == NFSERR_DELAY); if (error == EAUTH || error == EACCES) { /* Try again using system credentials */ @@ -3629,7 +3629,7 @@ nfscl_tryopen(struct nfsmount *nmp, vnod newfhlen, mode, op, name, namelen, ndpp, reclaim, delegtype, cred, p, 1, 0); if (error == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfstryop"); + (void) nfs_catnap(PZERO, error, "nfstryop"); } while (error == NFSERR_DELAY); } return (error); @@ -3652,7 +3652,8 @@ nfscl_trylock(struct nfsmount *nmp, vnod error = nfsrpc_lock(nd, nmp, vp, fhp, fhlen, nlp, newone, reclaim, off, len, type, cred, p, 0); if (!error && nd->nd_repstat == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfstrylck"); + (void) nfs_catnap(PZERO, (int)nd->nd_repstat, + "nfstrylck"); } while (!error && nd->nd_repstat == NFSERR_DELAY); if (!error) error = nd->nd_repstat; @@ -3663,7 +3664,8 @@ nfscl_trylock(struct nfsmount *nmp, vnod error = nfsrpc_lock(nd, nmp, vp, fhp, fhlen, nlp, newone, reclaim, off, len, type, cred, p, 1); if (!error && nd->nd_repstat == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfstrylck"); + (void) nfs_catnap(PZERO, (int)nd->nd_repstat, + "nfstrylck"); } while (!error && nd->nd_repstat == NFSERR_DELAY); if (!error) error = nd->nd_repstat; @@ -3685,7 +3687,7 @@ nfscl_trydelegreturn(struct nfscldeleg * do { error = nfsrpc_delegreturn(dp, cred, nmp, p, 0); if (error == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfstrydp"); + (void) nfs_catnap(PZERO, error, "nfstrydp"); } while (error == NFSERR_DELAY); if (error == EAUTH || error == EACCES) { /* Try again using system credentials */ @@ -3693,7 +3695,7 @@ nfscl_trydelegreturn(struct nfscldeleg * do { error = nfsrpc_delegreturn(dp, cred, nmp, p, 1); if (error == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfstrydp"); + (void) nfs_catnap(PZERO, error, "nfstrydp"); } while (error == NFSERR_DELAY); } return (error); @@ -3714,7 +3716,7 @@ nfscl_tryclose(struct nfsclopen *op, str do { error = nfsrpc_closerpc(nd, nmp, op, cred, p, 0); if (error == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfstrycl"); + (void) nfs_catnap(PZERO, error, "nfstrycl"); } while (error == NFSERR_DELAY); if (error == EAUTH || error == EACCES) { /* Try again using system credentials */ @@ -3722,7 +3724,7 @@ nfscl_tryclose(struct nfsclopen *op, str do { error = nfsrpc_closerpc(nd, nmp, op, cred, p, 1); if (error == NFSERR_DELAY) - (void) nfs_catnap(PZERO, "nfstrycl"); + (void) nfs_catnap(PZERO, error, "nfstrycl"); } while (error == NFSERR_DELAY); } return (error); Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sat May 1 00:36:40 2010 (r207454) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sat May 1 00:50:51 2010 (r207455) @@ -652,7 +652,7 @@ nfs_decode_args(struct mount *mp, struct while (newnfs_connect(nmp, &nmp->nm_sockreq, cred, td, 0)) { printf("newnfs_args: retrying connect\n"); - (void) nfs_catnap(PSOCK, "newnfscon"); + (void) nfs_catnap(PSOCK, 0, "newnfscon"); } } } else { @@ -1188,7 +1188,7 @@ mountnfs(struct nfs_args *argp, struct m error = nfsrpc_getdirpath(nmp, NFSMNT_DIRPATH(nmp), cred, td); if (error) - (void) nfs_catnap(PZERO, "nfsgetdirp"); + (void) nfs_catnap(PZERO, error, "nfsgetdirp"); } while (error && --trycnt > 0); if (error) { error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0); @@ -1284,7 +1284,7 @@ nfs_unmount(struct mount *mp, int mntfla do { error = vflush(mp, 1, flags, td); if ((mntflags & MNT_FORCE) && error != 0 && ++trycnt < 30) - (void) nfs_catnap(PSOCK, "newndm"); + (void) nfs_catnap(PSOCK, error, "newndm"); } while ((mntflags & MNT_FORCE) && error != 0 && trycnt < 30); if (error) goto out; Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Sat May 1 00:36:40 2010 (r207454) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Sat May 1 00:50:51 2010 (r207455) @@ -2871,7 +2871,8 @@ nfs_advlock(struct vop_advlock_args *ap) if (ret == NFSERR_DENIED && (ap->a_flags & F_WAIT) && ap->a_op == F_SETLK) { VOP_UNLOCK(vp, 0); - error = nfs_catnap(PZERO | PCATCH, "ncladvl"); + error = nfs_catnap(PZERO | PCATCH, ret, + "ncladvl"); if (error) return (EINTR); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat May 1 00:36:40 2010 (r207454) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat May 1 00:50:51 2010 (r207455) @@ -4578,7 +4578,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO 100000) return; /* Sleep for a short period of time */ - (void) nfs_catnap(PZERO, "nfsremove"); + (void) nfs_catnap(PZERO, 0, "nfsremove"); } } while (error == NFSERR_DELAY); } From owner-svn-src-all@FreeBSD.ORG Sat May 1 01:05:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF73A1065673; Sat, 1 May 2010 01:05:07 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 68E0C8FC13; Sat, 1 May 2010 01: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 o41157hq032667; Sat, 1 May 2010 01:05:07 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41157GE032665; Sat, 1 May 2010 01:05:07 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201005010105.o41157GE032665@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 1 May 2010 01:05: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: r207456 - head/sys/compat/x86bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 01:05:07 -0000 Author: jkim Date: Sat May 1 01:05:07 2010 New Revision: 207456 URL: http://svn.freebsd.org/changeset/base/207456 Log: Reduce MD code further. At least, it compiles on ia64 now (but it is not connected to build). The idea/code was shamelessly taken from r207329. Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Sat May 1 00:50:51 2010 (r207455) +++ head/sys/compat/x86bios/x86bios.c Sat May 1 01:05:07 2010 (r207456) @@ -47,11 +47,15 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include +#if defined(__amd64__) || defined(__i386__) +#define X86BIOS_NATIVE_ARCH +#endif + #define X86BIOS_PAGE_SIZE 0x00001000 /* 4K */ #define X86BIOS_IVT_SIZE 0x00000500 /* 1K + 256 (BDA) */ @@ -236,27 +240,49 @@ x86bios_emu_inb(struct x86emu *emu, uint if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); - return (inb(port)); + return (iodev_read_1(port)); } static uint16_t x86bios_emu_inw(struct x86emu *emu, uint16_t port) { + uint16_t val; if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); - return (inw(port)); +#ifndef X86BIOS_NATIVE_ARCH + if ((port & 1) != 0) { + val = iodev_read_1(port); + val |= iodev_read_1(port + 1) << 8; + } else +#endif + val = iodev_read_2(port); + + return (val); } static uint32_t x86bios_emu_inl(struct x86emu *emu, uint16_t port) { + uint32_t val; if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); - return (inl(port)); +#ifndef X86BIOS_NATIVE_ARCH + if ((port & 1) != 0) { + val = iodev_read_1(port); + val |= iodev_read_2(port + 1) << 8; + val |= iodev_read_1(port + 3) << 24; + } else if ((port & 2) != 0) { + val = iodev_read_2(port); + val |= iodev_read_2(port + 2) << 16; + } else +#endif + val = iodev_read_4(port); + + return (val); } static void @@ -268,7 +294,7 @@ x86bios_emu_outb(struct x86emu *emu, uin if (port >= 0x80 && port < 0x88) /* POST status register */ return; - outb(port, val); + iodev_write_1(port, val); } static void @@ -278,7 +304,13 @@ x86bios_emu_outw(struct x86emu *emu, uin if (port >= 0x80 && port < 0x88) /* POST status register */ return; - outw(port, val); +#ifndef X86BIOS_NATIVE_ARCH + if ((port & 1) != 0) { + iodev_write_1(port, val); + iodev_write_1(port + 1, val >> 8); + } else +#endif + iodev_write_2(port, val); } static void @@ -288,7 +320,17 @@ x86bios_emu_outl(struct x86emu *emu, uin if (port >= 0x80 && port < 0x88) /* POST status register */ return; - outl(port, val); +#ifndef X86BIOS_NATIVE_ARCH + if ((port & 1) != 0) { + iodev_write_1(port, val); + iodev_write_2(port + 1, val >> 8); + iodev_write_1(port + 3, val >> 24); + } else if ((port & 2) != 0) { + iodev_write_2(port, val); + iodev_write_2(port + 2, val >> 16); + } else +#endif + iodev_write_4(port, val); } static void @@ -484,45 +526,53 @@ x86bios_match_device(uint32_t offset, de return (1); } -#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) -#define PROBE_EBDA 1 +static __inline void +x86bios_unmap_mem(void) +{ + + if (x86bios_ivt != NULL) +#ifdef X86BIOS_NATIVE_ARCH + pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); #else -#define PROBE_EBDA 0 + free(x86bios_ivt, M_DEVBUF); #endif + if (x86bios_rom != NULL) + pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE); + if (x86bios_seg != NULL) + contigfree(x86bios_seg, X86BIOS_SEG_SIZE, M_DEVBUF); +} static __inline int x86bios_map_mem(void) { +#ifdef X86BIOS_NATIVE_ARCH x86bios_ivt = pmap_mapbios(X86BIOS_IVT_BASE, X86BIOS_IVT_SIZE); - if (x86bios_ivt == NULL) - return (1); -#if PROBE_EBDA +#ifndef PC98 /* Probe EBDA via BDA. */ - x86bios_rom_phys = *(uint16_t *)((vm_offset_t)x86bios_ivt + 0x40e); - x86bios_rom_phys = le16toh(x86bios_rom_phys) << 4; + x86bios_rom_phys = *(uint16_t *)((caddr_t)x86bios_ivt + 0x40e); + x86bios_rom_phys = x86bios_rom_phys << 4; if (x86bios_rom_phys != 0 && x86bios_rom_phys < X86BIOS_ROM_BASE && X86BIOS_ROM_BASE - x86bios_rom_phys <= 128 * 1024) x86bios_rom_phys = rounddown(x86bios_rom_phys, X86BIOS_PAGE_SIZE); else #endif +#else + x86bios_ivt = malloc(X86BIOS_IVT_SIZE, M_DEVBUF, M_ZERO | M_WAITOK); +#endif + x86bios_rom_phys = X86BIOS_ROM_BASE; x86bios_rom = pmap_mapdev(x86bios_rom_phys, X86BIOS_ROM_SIZE); - if (x86bios_rom == NULL) { - pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); - return (1); - } -#if PROBE_EBDA + if (x86bios_rom == NULL) + goto fail; +#if defined(X86BIOS_NATIVE_ARCH) && !defined(PC98) /* Change attribute for EBDA. */ if (x86bios_rom_phys < X86BIOS_ROM_BASE && pmap_change_attr((vm_offset_t)x86bios_rom, - X86BIOS_ROM_BASE - x86bios_rom_phys, PAT_WRITE_BACK) != 0) { - pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); - pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE); - return (1); - } + X86BIOS_ROM_BASE - x86bios_rom_phys, PAT_WRITE_BACK) != 0) + goto fail; #endif x86bios_seg = contigmalloc(X86BIOS_SEG_SIZE, M_DEVBUF, M_WAITOK, @@ -537,12 +587,10 @@ x86bios_map_mem(void) (uint32_t)x86bios_seg_phys, X86BIOS_SEG_SIZE + (uint32_t)x86bios_seg_phys - 1, x86bios_seg); -#if PROBE_EBDA if (x86bios_rom_phys < X86BIOS_ROM_BASE) printf("x86bios: EBDA 0x%06x-0x%06x at %p\n", (uint32_t)x86bios_rom_phys, X86BIOS_ROM_BASE - 1, x86bios_rom); -#endif printf("x86bios: ROM 0x%06x-0x%06x at %p\n", X86BIOS_ROM_BASE, X86BIOS_MEM_SIZE - X86BIOS_SEG_SIZE - 1, (void *)((vm_offset_t)x86bios_rom + X86BIOS_ROM_BASE - @@ -550,17 +598,11 @@ x86bios_map_mem(void) } return (0); -} -#undef PROBE_EBDA +fail: + x86bios_unmap_mem(); -static __inline void -x86bios_unmap_mem(void) -{ - - pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); - pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE); - contigfree(x86bios_seg, X86BIOS_SEG_SIZE, M_DEVBUF); + return (1); } static int From owner-svn-src-all@FreeBSD.ORG Sat May 1 03:41:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F0DA106564A; Sat, 1 May 2010 03:41:22 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3F2668FC12; Sat, 1 May 2010 03:41: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 o413fMRb067070; Sat, 1 May 2010 03:41:22 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o413fMhP067068; Sat, 1 May 2010 03:41:22 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201005010341.o413fMhP067068@svn.freebsd.org> From: Kip Macy Date: Sat, 1 May 2010 03:41: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: r207460 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 03:41:22 -0000 Author: kmacy Date: Sat May 1 03:41:21 2010 New Revision: 207460 URL: http://svn.freebsd.org/changeset/base/207460 Log: Update locking comment above vm_page: - re-assign page queue lock "Q" - assign page lock "P" - update several uncommented fields - observe that hold_count is now protected by the page lock "P" Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sat May 1 02:53:43 2010 (r207459) +++ head/sys/vm/vm_page.h Sat May 1 03:41:21 2010 (r207460) @@ -90,20 +90,21 @@ * and sundry status bits. * * Fields in this structure are locked either by the lock on the - * object that the page belongs to (O) or by the lock on the page - * queues (P). + * object that the page belongs to (O), its corresponding page lock (P), + * or by the lock on the page queues (Q). + * */ TAILQ_HEAD(pglist, vm_page); struct vm_page { - TAILQ_ENTRY(vm_page) pageq; /* queue info for FIFO queue or free list (P) */ + TAILQ_ENTRY(vm_page) pageq; /* queue info for FIFO queue or free list (Q) */ TAILQ_ENTRY(vm_page) listq; /* pages in same object (O) */ struct vm_page *left; /* splay tree link (O) */ struct vm_page *right; /* splay tree link (O) */ - vm_object_t object; /* which object am I in (O,P)*/ - vm_pindex_t pindex; /* offset into object (O,P) */ + vm_object_t object; /* which object am I in (O,Q)*/ + vm_pindex_t pindex; /* offset into object (O,Q) */ vm_paddr_t phys_addr; /* physical address of page */ struct md_page md; /* machine dependant stuff */ uint8_t queue; /* page queue index */ @@ -111,11 +112,11 @@ struct vm_page { u_short flags; /* see below */ uint8_t order; /* index of the buddy queue */ uint8_t pool; - u_short cow; /* page cow mapping count */ - u_int wire_count; /* wired down maps refs (P) */ - short hold_count; /* page hold count */ + u_short cow; /* page cow mapping count (Q) */ + u_int wire_count; /* wired down maps refs (Q) */ + short hold_count; /* page hold count (P) */ u_short oflags; /* page flags (O) */ - u_char act_count; /* page usage count */ + u_char act_count; /* page usage count (Q) */ u_char busy; /* page busy count (O) */ /* NOTE that these must support one bit per DEV_BSIZE in a page!!! */ /* so, on normal X86 kernels, they must be at least 8 bits wide */ From owner-svn-src-all@FreeBSD.ORG Sat May 1 07:25:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 226CA106564A; Sat, 1 May 2010 07:25:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 128658FC0A; Sat, 1 May 2010 07:25:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o417PSuc017514; Sat, 1 May 2010 07:25:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o417PSlX017513; Sat, 1 May 2010 07:25:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201005010725.o417PSlX017513@svn.freebsd.org> From: Warner Losh Date: Sat, 1 May 2010 07:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207461 - head/usr.sbin/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 07:25:29 -0000 Author: imp Date: Sat May 1 07:25:28 2010 New Revision: 207461 URL: http://svn.freebsd.org/changeset/base/207461 Log: sparc64, and possibly other architectures, pads the length of the section holding the config file to sh_addralign bytes using NULs. This bogusly triggers an assert. Break out of the loop when we hit an NUL within that many bytes of the end. MFC after: 3 days Modified: head/usr.sbin/config/main.c Modified: head/usr.sbin/config/main.c ============================================================================== --- head/usr.sbin/config/main.c Sat May 1 03:41:21 2010 (r207460) +++ head/usr.sbin/config/main.c Sat May 1 07:25:28 2010 (r207461) @@ -670,7 +670,7 @@ kernconfdump(const char *file) struct stat st; FILE *fp, *pp; int error, len, osz, r; - unsigned int i, off, size; + unsigned int i, off, size, t1, t2, align; char *cmd, *o; r = open(file, O_RDONLY); @@ -689,8 +689,8 @@ kernconfdump(const char *file) if (o == NULL) err(EXIT_FAILURE, "Couldn't allocate memory"); /* ELF note section header. */ - asprintf(&cmd, "/usr/bin/elfdump -c %s | grep -A 5 kern_conf" - "| tail -2 | cut -d ' ' -f 2 | paste - - -", file); + asprintf(&cmd, "/usr/bin/elfdump -c %s | grep -A 8 kern_conf" + "| tail -5 | cut -d ' ' -f 2 | paste - - - - -", file); if (cmd == NULL) errx(EXIT_FAILURE, "asprintf() failed"); pp = popen(cmd, "r"); @@ -699,24 +699,28 @@ kernconfdump(const char *file) free(cmd); len = fread(o, osz, 1, pp); pclose(pp); - r = sscanf(o, "%d\t%d", &off, &size); + r = sscanf(o, "%d%d%d%d%d", &off, &size, &t1, &t2, &align); free(o); - if (r != 2) + if (r != 5) errx(EXIT_FAILURE, "File %s doesn't contain configuration " "file. Either unsupported, or not compiled with " "INCLUDE_CONFIG_FILE", file); r = fseek(fp, off, SEEK_CUR); if (r != 0) err(EXIT_FAILURE, "fseek() failed"); - for (i = 0; i < size - 1; i++) { + for (i = 0; i < size; i++) { r = fgetc(fp); if (r == EOF) break; /* * If '\0' is present in the middle of the configuration * string, this means something very weird is happening. - * Make such case very visible. + * Make such case very visible. However, some architectures + * pad the length of the section with NULs to a multiple of + * sh_addralign, allow a NUL in that part of the section. */ + if (r == '\0' && (size - i) < align) + break; assert(r != '\0' && ("Char present in the configuration " "string mustn't be equal to 0")); fputc(r, stdout); From owner-svn-src-all@FreeBSD.ORG Sat May 1 09:05:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 199B71065674; Sat, 1 May 2010 09:05:07 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0A0608FC27; Sat, 1 May 2010 09: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 o41956NB065959; Sat, 1 May 2010 09:05:06 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4195600065956; Sat, 1 May 2010 09:05:06 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201005010905.o4195600065956@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 1 May 2010 09:05: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: r207462 - head/sbin/tunefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 09:05:07 -0000 Author: edwin Date: Sat May 1 09:05:06 2010 New Revision: 207462 URL: http://svn.freebsd.org/changeset/base/207462 Log: Improve usage of tunefs: Document -j switch in usage() to reflect recent SUJ work. Submitted by: Alastair Hogge MFC after: 1 week Modified: head/sbin/tunefs/tunefs.c Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Sat May 1 07:25:28 2010 (r207461) +++ head/sbin/tunefs/tunefs.c Sat May 1 09:05:06 2010 (r207462) @@ -1007,10 +1007,11 @@ out: void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", "usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]", -" [-J enable | disable ] [-L volname] [-l enable | disable]", -" [-m minfree] [-N enable | disable] [-n enable | disable]", +" [-J enable | disable] [-j enable | disable]", +" [-L volname] [-l enable | disable] [-m minfree]", +" [-N enable | disable] [-n enable | disable]", " [-o space | time] [-p] [-s avgfpdir] special | filesystem"); exit(2); } From owner-svn-src-all@FreeBSD.ORG Sat May 1 13:15:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0F141065670; Sat, 1 May 2010 13:15:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 672838FC12; Sat, 1 May 2010 13:15: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 o41DFZfI047979; Sat, 1 May 2010 13:15:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41DFZs4047977; Sat, 1 May 2010 13:15:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005011315.o41DFZs4047977@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 May 2010 13:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207463 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 13:15:36 -0000 Author: kib Date: Sat May 1 13:15:35 2010 New Revision: 207463 URL: http://svn.freebsd.org/changeset/base/207463 Log: Remove debugging code that was not used once since commit. Suggested by: bde MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sat May 1 09:05:06 2010 (r207462) +++ head/sys/amd64/amd64/trap.c Sat May 1 13:15:35 2010 (r207463) @@ -172,52 +172,6 @@ SYSCTL_INT(_machdep, OID_AUTO, prot_faul extern char *syscallnames[]; -/* #define DEBUG 1 */ -#ifdef DEBUG -static void -report_seg_fault(const char *segn, struct trapframe *frame) -{ - struct proc_ldt *pldt; - struct trapframe *pf; - - pldt = curproc->p_md.md_ldt; - printf("%d: %s load fault %lx %p %d\n", - curproc->p_pid, segn, frame->tf_err, - pldt != NULL ? pldt->ldt_base : NULL, - pldt != NULL ? pldt->ldt_refcnt : 0); - kdb_backtrace(); - pf = (struct trapframe *)frame->tf_rsp; - printf("rdi %lx\n", pf->tf_rdi); - printf("rsi %lx\n", pf->tf_rsi); - printf("rdx %lx\n", pf->tf_rdx); - printf("rcx %lx\n", pf->tf_rcx); - printf("r8 %lx\n", pf->tf_r8); - printf("r9 %lx\n", pf->tf_r9); - printf("rax %lx\n", pf->tf_rax); - printf("rbx %lx\n", pf->tf_rbx); - printf("rbp %lx\n", pf->tf_rbp); - printf("r10 %lx\n", pf->tf_r10); - printf("r11 %lx\n", pf->tf_r11); - printf("r12 %lx\n", pf->tf_r12); - printf("r13 %lx\n", pf->tf_r13); - printf("r14 %lx\n", pf->tf_r14); - printf("r15 %lx\n", pf->tf_r15); - printf("fs %x\n", pf->tf_fs); - printf("gs %x\n", pf->tf_gs); - printf("es %x\n", pf->tf_es); - printf("ds %x\n", pf->tf_ds); - printf("tno %x\n", pf->tf_trapno); - printf("adr %lx\n", pf->tf_addr); - printf("flg %x\n", pf->tf_flags); - printf("err %lx\n", pf->tf_err); - printf("rip %lx\n", pf->tf_rip); - printf("cs %lx\n", pf->tf_cs); - printf("rfl %lx\n", pf->tf_rflags); - printf("rsp %lx\n", pf->tf_rsp); - printf("ss %lx\n", pf->tf_ss); -} -#endif - /* * Exception, fault, and trap interface to the FreeBSD kernel. * This common code is called from assembly language IDT gate entry @@ -314,9 +268,7 @@ trap(struct trapframe *frame) */ printf("kernel trap %d with interrupts disabled\n", type); -#ifdef DEBUG - report_seg_fault("hlt", frame); -#endif + /* * We shouldn't enable interrupts while holding a * spin lock or servicing an NMI. @@ -535,33 +487,21 @@ trap(struct trapframe *frame) goto out; } if (frame->tf_rip == (long)ld_ds) { -#ifdef DEBUG - report_seg_fault("ds", frame); -#endif frame->tf_rip = (long)ds_load_fault; frame->tf_ds = _udatasel; goto out; } if (frame->tf_rip == (long)ld_es) { -#ifdef DEBUG - report_seg_fault("es", frame); -#endif frame->tf_rip = (long)es_load_fault; frame->tf_es = _udatasel; goto out; } if (frame->tf_rip == (long)ld_fs) { -#ifdef DEBUG - report_seg_fault("fs", frame); -#endif frame->tf_rip = (long)fs_load_fault; frame->tf_fs = _ufssel; goto out; } if (frame->tf_rip == (long)ld_gs) { -#ifdef DEBUG - report_seg_fault("gs", frame); -#endif frame->tf_rip = (long)gs_load_fault; frame->tf_gs = _ugssel; goto out; @@ -667,30 +607,6 @@ trap(struct trapframe *frame) ksi.ksi_addr = (void *)addr; trapsignal(td, &ksi); -#ifdef DEBUG -{ - register_t rg,rgk, rf; - - if (type <= MAX_TRAP_MSG) { - uprintf("fatal process exception: %s", - trap_msg[type]); - if ((type == T_PAGEFLT) || (type == T_PROTFLT)) - uprintf(", fault VA = 0x%lx", frame->tf_addr); - uprintf("\n"); - } - rf = rdmsr(0xc0000100); - rg = rdmsr(0xc0000101); - rgk = rdmsr(0xc0000102); - uprintf("pid %d TRAP %d rip %lx err %lx addr %lx cs %lx ss %lx ds %x " - "es %x fs %x fsbase %lx %lx gs %x gsbase %lx %lx %lx\n", - curproc->p_pid, type, frame->tf_rip, frame->tf_err, - frame->tf_addr, - frame->tf_cs, frame->tf_ss, frame->tf_ds, frame->tf_es, - frame->tf_fs, td->td_pcb->pcb_fsbase, rf, - frame->tf_gs, td->td_pcb->pcb_gsbase, rg, rgk); -} -#endif - user: userret(td, frame); mtx_assert(&Giant, MA_NOTOWNED); From owner-svn-src-all@FreeBSD.ORG Sat May 1 14:29:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D691B1065673; Sat, 1 May 2010 14:29:33 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C53288FC12; Sat, 1 May 2010 14:29: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 o41ETXkk032688; Sat, 1 May 2010 14:29:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41ETXjm032686; Sat, 1 May 2010 14:29:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005011429.o41ETXjm032686@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 1 May 2010 14:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207464 - stable/8/bin/ln X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 14:29:34 -0000 Author: jilles Date: Sat May 1 14:29:33 2010 New Revision: 207464 URL: http://svn.freebsd.org/changeset/base/207464 Log: MFC r206773: ln: Do not delete a file by hardlinking it to itself. Two pathnames refer to the same directory entry iff the directories match and the final components' names match. Example: (assuming file1 is an existing file) ln -f file1 file1 This now fails while leaving file1 intact. It used to delete file1 and then complain it cannot be linked because it is gone. With -i, this error is detected before the question is asked. Modified: stable/8/bin/ln/ln.c Directory Properties: stable/8/bin/ln/ (props changed) Modified: stable/8/bin/ln/ln.c ============================================================================== --- stable/8/bin/ln/ln.c Sat May 1 13:15:35 2010 (r207463) +++ stable/8/bin/ln/ln.c Sat May 1 14:29:33 2010 (r207464) @@ -172,6 +172,52 @@ main(int argc, char *argv[]) exit(exitval); } +/* + * Two pathnames refer to the same directory entry if the directories match + * and the final components' names match. + */ +static int +samedirent(const char *path1, const char *path2) +{ + const char *file1, *file2; + char pathbuf[PATH_MAX]; + struct stat sb1, sb2; + + if (strcmp(path1, path2) == 0) + return 1; + file1 = strrchr(path1, '/'); + if (file1 != NULL) + file1++; + else + file1 = path1; + file2 = strrchr(path2, '/'); + if (file2 != NULL) + file2++; + else + file2 = path2; + if (strcmp(file1, file2) != 0) + return 0; + if (file1 - path1 >= PATH_MAX || file2 - path2 >= PATH_MAX) + return 0; + if (file1 == path1) + memcpy(pathbuf, ".", 2); + else { + memcpy(pathbuf, path1, file1 - path1); + pathbuf[file1 - path1] = '\0'; + } + if (stat(pathbuf, &sb1) != 0) + return 0; + if (file2 == path2) + memcpy(pathbuf, ".", 2); + else { + memcpy(pathbuf, path2, file2 - path2); + pathbuf[file2 - path2] = '\0'; + } + if (stat(pathbuf, &sb2) != 0) + return 0; + return sb1.st_dev == sb2.st_dev && sb1.st_ino == sb2.st_ino; +} + int linkit(const char *source, const char *target, int isdir) { @@ -215,7 +261,6 @@ linkit(const char *source, const char *t target = path; } - exists = !lstat(target, &sb); /* * If the link source doesn't exist, and a symbolic link was * requested, and -w was specified, give a warning. @@ -242,8 +287,20 @@ linkit(const char *source, const char *t warn("warning: %s", source); } } + + /* + * If the file exists, first check it is not the same directory entry. + */ + exists = !lstat(target, &sb); + if (exists) { + if (!sflag && samedirent(source, target)) { + warnx("%s and %s are the same directory entry", + source, target); + return (1); + } + } /* - * If the file exists, then unlink it forcibly if -f was specified + * Then unlink it forcibly if -f was specified * and interactively if -i was specified. */ if (fflag && exists) { From owner-svn-src-all@FreeBSD.ORG Sat May 1 14:33:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A381C106566B; Sat, 1 May 2010 14:33:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9211F8FC1C; Sat, 1 May 2010 14:33: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 o41EXQtO037367; Sat, 1 May 2010 14:33:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41EXQMg037364; Sat, 1 May 2010 14:33:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005011433.o41EXQMg037364@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 1 May 2010 14:33: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: r207465 - stable/8/bin/ln X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 14:33:26 -0000 Author: jilles Date: Sat May 1 14:33:26 2010 New Revision: 207465 URL: http://svn.freebsd.org/changeset/base/207465 Log: MFC r207021: ln: Allow a trailing slash when creating a link to a directory. In the 'ln source... directory' synopsis, the basename of each source determines the name of the created link. Determine this using basename(3) instead of strrchr(..., '/') which is incorrect if the pathname ends in a slash. PR: 121568 Modified: stable/8/bin/ln/ln.c Directory Properties: stable/8/bin/ln/ (props changed) Modified: stable/8/bin/ln/ln.c ============================================================================== --- stable/8/bin/ln/ln.c Sat May 1 14:29:33 2010 (r207464) +++ stable/8/bin/ln/ln.c Sat May 1 14:33:26 2010 (r207465) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -226,6 +227,7 @@ linkit(const char *source, const char *t int ch, exists, first; char path[PATH_MAX]; char wbuf[PATH_MAX]; + char bbuf[PATH_MAX]; if (!sflag) { /* If source doesn't exist, quit now. */ @@ -248,11 +250,9 @@ linkit(const char *source, const char *t if (isdir || (lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) || (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode))) { - if ((p = strrchr(source, '/')) == NULL) - p = source; - else - ++p; - if (snprintf(path, sizeof(path), "%s/%s", target, p) >= + if (strlcpy(bbuf, source, sizeof(bbuf)) >= sizeof(bbuf) || + (p = basename(bbuf)) == NULL || + snprintf(path, sizeof(path), "%s/%s", target, p) >= (ssize_t)sizeof(path)) { errno = ENAMETOOLONG; warn("%s", source); @@ -276,15 +276,14 @@ linkit(const char *source, const char *t * absolute path of the source, by appending `source' * to the parent directory of the target. */ - p = strrchr(target, '/'); - if (p != NULL) - p++; - else - p = target; - (void)snprintf(wbuf, sizeof(wbuf), "%.*s%s", - (int)(p - target), target, source); - if (stat(wbuf, &sb) != 0) - warn("warning: %s", source); + strlcpy(bbuf, target, sizeof(bbuf)); + p = dirname(bbuf); + if (p != NULL) { + (void)snprintf(wbuf, sizeof(wbuf), "%s/%s", + p, source); + if (stat(wbuf, &sb) != 0) + warn("warning: %s", source); + } } } From owner-svn-src-all@FreeBSD.ORG Sat May 1 14:36:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 352C6106566B; Sat, 1 May 2010 14:36:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 239C08FC13; Sat, 1 May 2010 14:36: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 o41Ea5qL040502; Sat, 1 May 2010 14:36:05 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41Ea5eo040499; Sat, 1 May 2010 14:36:05 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005011436.o41Ea5eo040499@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 1 May 2010 14:36:04 +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: r207466 - stable/8/usr.bin/stat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 14:36:05 -0000 Author: jilles Date: Sat May 1 14:36:04 2010 New Revision: 207466 URL: http://svn.freebsd.org/changeset/base/207466 Log: MFC r207153: stat: Allow -f %Sf to display the file flags symbolically. PR: 124349 Modified: stable/8/usr.bin/stat/stat.1 stable/8/usr.bin/stat/stat.c Directory Properties: stable/8/usr.bin/stat/ (props changed) Modified: stable/8/usr.bin/stat/stat.1 ============================================================================== --- stable/8/usr.bin/stat/stat.1 Sat May 1 14:33:26 2010 (r207465) +++ stable/8/usr.bin/stat/stat.1 Sat May 1 14:36:04 2010 (r207466) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2007 +.Dd April 24, 2010 .Dt STAT 1 .Os .Sh NAME @@ -239,6 +239,11 @@ Display date in format. .It Cm dr Display actual device name. +.It Cm f +Display the flags of +.Ar file +as in +.Nm ls Fl lTdo . .It Cm gu Display group or user name. .It Cm p Modified: stable/8/usr.bin/stat/stat.c ============================================================================== --- stable/8/usr.bin/stat/stat.c Sat May 1 14:33:26 2010 (r207465) +++ stable/8/usr.bin/stat/stat.c Sat May 1 14:36:04 2010 (r207466) @@ -189,6 +189,9 @@ int format1(const struct stat *, /* stat char *, size_t, /* a place to put the output */ int, int, int, int, /* the parsed format */ int, int); +#if HAVE_STRUCT_STAT_ST_FLAGS +char *xfflagstostr(unsigned long); +#endif char *timefmt; int linkfail; @@ -340,6 +343,25 @@ main(int argc, char *argv[]) return (am_readlink ? linkfail : errs); } +#if HAVE_STRUCT_STAT_ST_FLAGS +/* + * fflagstostr() wrapper that leaks only once + */ +char * +xfflagstostr(unsigned long fflags) +{ + static char *str = NULL; + + if (str != NULL) + free(str); + + str = fflagstostr(fflags); + if (str == NULL) + err(1, "fflagstostr"); + return (str); +} +#endif /* HAVE_STRUCT_STAT_ST_FLAGS */ + void usage(const char *synopsis) { @@ -732,8 +754,11 @@ format1(const struct stat *st, case SHOW_st_flags: small = (sizeof(st->st_flags) == 4); data = st->st_flags; - sdata = NULL; - formats = FMTF_DECIMAL | FMTF_OCTAL | FMTF_UNSIGNED | FMTF_HEX; + sdata = xfflagstostr(st->st_flags); + if (*sdata == '\0') + sdata = "-"; + formats = FMTF_DECIMAL | FMTF_OCTAL | FMTF_UNSIGNED | FMTF_HEX | + FMTF_STRING; if (ofmt == 0) ofmt = FMTF_UNSIGNED; break; From owner-svn-src-all@FreeBSD.ORG Sat May 1 14:41:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 76F701065675; Sat, 1 May 2010 14:41:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 652308FC15; Sat, 1 May 2010 14:41: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 o41EfbuY046553; Sat, 1 May 2010 14:41:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41Efb0H046551; Sat, 1 May 2010 14:41:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005011441.o41Efb0H046551@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 1 May 2010 14:41: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: r207467 - stable/8/share/man/man1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 14:41:37 -0000 Author: jilles Date: Sat May 1 14:41:37 2010 New Revision: 207467 URL: http://svn.freebsd.org/changeset/base/207467 Log: MFC r207166: builtin(1): Mention [ sh builtin. Modified: stable/8/share/man/man1/builtin.1 Directory Properties: stable/8/share/man/man1/ (props changed) Modified: stable/8/share/man/man1/builtin.1 ============================================================================== --- stable/8/share/man/man1/builtin.1 Sat May 1 14:36:04 2010 (r207466) +++ stable/8/share/man/man1/builtin.1 Sat May 1 14:41:37 2010 (r207467) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2006 +.Dd April 25, 2010 .Dt BUILTIN 1 .Os .Sh NAME @@ -36,6 +36,7 @@ .Nm \&. , .Nm \&: , .Nm @ , +.Nm \&[ , .Nm { , .Nm } , .Nm alias , @@ -200,6 +201,7 @@ but are implemented as scripts using a b .It Ic . Ta \&No Ta \&No Ta Yes .It Ic : Ta \&No Ta Yes Ta Yes .It Ic @ Ta \&No Ta Yes Ta Yes +.It Ic \&[ Ta Yes Ta \&No Ta Yes .It Ic { Ta \&No Ta \&No Ta Yes .It Ic } Ta \&No Ta \&No Ta Yes .It Ic alias Ta No** Ta Yes Ta Yes From owner-svn-src-all@FreeBSD.ORG Sat May 1 14:46:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E6B21065670; Sat, 1 May 2010 14:46:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4D6008FC1C; Sat, 1 May 2010 14:46: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 o41EkIcl051909; Sat, 1 May 2010 14:46:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41EkIa6051907; Sat, 1 May 2010 14:46:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005011446.o41EkIa6051907@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 May 2010 14:46: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: r207468 - 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, 01 May 2010 14:46:18 -0000 Author: kib Date: Sat May 1 14:46:17 2010 New Revision: 207468 URL: http://svn.freebsd.org/changeset/base/207468 Log: Extract thread_lock()/ruxagg()/thread_unlock() fragment into utility function ruxagg_tlock(). Convert the definition of kern_getrusage() to ANSI C. Submitted by: Alexander Krizhanovsky MFC after: 1 week Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Sat May 1 14:41:37 2010 (r207467) +++ head/sys/kern/kern_resource.c Sat May 1 14:46:17 2010 (r207468) @@ -76,6 +76,7 @@ static void calcru1(struct proc *p, stru struct timeval *up, struct timeval *sp); static int donice(struct thread *td, struct proc *chgp, int n); static struct uidinfo *uilookup(uid_t uid); +static void ruxagg_tlock(struct proc *p, struct thread *td); /* * Resource controls and accounting. @@ -629,9 +630,7 @@ lim_cb(void *arg) return; PROC_SLOCK(p); FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - ruxagg(&p->p_rux, td); - thread_unlock(td); + ruxagg_tlock(p, td); } PROC_SUNLOCK(p); if (p->p_rux.rux_runtime > p->p_cpulimit * cpu_tickrate()) { @@ -842,9 +841,7 @@ calcru(struct proc *p, struct timeval *u FOREACH_THREAD_IN_PROC(p, td) { if (td->td_incruntime == 0) continue; - thread_lock(td); - ruxagg(&p->p_rux, td); - thread_unlock(td); + ruxagg_tlock(p, td); } calcru1(p, &p->p_rux, up, sp); } @@ -945,10 +942,7 @@ getrusage(td, uap) } int -kern_getrusage(td, who, rup) - struct thread *td; - int who; - struct rusage *rup; +kern_getrusage(struct thread *td, int who, struct rusage *rup) { struct proc *p; int error; @@ -1022,6 +1016,15 @@ ruxagg(struct rusage_ext *rux, struct th td->td_sticks = 0; } +static void +ruxagg_tlock(struct proc *p, struct thread *td) +{ + + thread_lock(td); + ruxagg(&p->p_rux, td); + thread_unlock(td); +} + /* * Update the rusage_ext structure and fetch a valid aggregate rusage * for proc p if storage for one is supplied. @@ -1036,9 +1039,7 @@ rufetch(struct proc *p, struct rusage *r *ru = p->p_ru; if (p->p_numthreads > 0) { FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - ruxagg(&p->p_rux, td); - thread_unlock(td); + ruxagg_tlock(p, td); rucollect(ru, &td->td_ru); } } From owner-svn-src-all@FreeBSD.ORG Sat May 1 14:47:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4672C106566C; Sat, 1 May 2010 14:47:44 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 510C78FC1B; Sat, 1 May 2010 14:47:42 +0000 (UTC) Received: by fxm15 with SMTP id 15so1104891fxm.13 for ; Sat, 01 May 2010 07:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=/AyNe7mYpH/cSlb+thC9jpq1ksp/oDqKPMDwRc+RakY=; b=bM+WP6vCh/LZ/Xms3a2pm3GEVInav3u/e3r2Db5WdgstTPdbfCMuKij+caaEJGVg9v rwBLEToUTmdEv6mGYpRAWzGrVyZy+3mn7/A07STC2m2TB1TmYQ8bGwzt9vGVIaXl9glT UyS7cUp8N/YFQoH+I7mhV5nuvjNFrgmrnTNlY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=dhsMRi7AFv/vDyiqqmcfMgAx95VPOXnKRdPGyyUA9G4RpR+2mbohDtmHpgPAhK4MLg /S79y92gYAY/UHXXLtS5hqx7qe/GQd0kBEP1aZNp0R2JQ4ZNCkeLNQTHxfsgBUWCnsop Y5Fb7m6CgoArL3JjfQY5BPIE056Z+1JwI0xJg= MIME-Version: 1.0 Received: by 10.239.174.70 with SMTP id i6mr111171hbf.180.1272725256702; Sat, 01 May 2010 07:47:36 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.239.129.207 with HTTP; Sat, 1 May 2010 07:47:36 -0700 (PDT) In-Reply-To: <201005011446.o41EkIa6051907@svn.freebsd.org> References: <201005011446.o41EkIa6051907@svn.freebsd.org> Date: Sat, 1 May 2010 16:47:36 +0200 X-Google-Sender-Auth: F2yINjqopaZjyeKnVGqocMmNeqI Message-ID: From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207468 - 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, 01 May 2010 14:47:44 -0000 2010/5/1 Konstantin Belousov : > Author: kib > Date: Sat May =C2=A01 14:46:17 2010 > New Revision: 207468 > URL: http://svn.freebsd.org/changeset/base/207468 > > Log: > =C2=A0Extract thread_lock()/ruxagg()/thread_unlock() fragment into utilit= y > =C2=A0function ruxagg_tlock(). > =C2=A0Convert the definition of kern_getrusage() to ANSI C. > I would have preferred a different naming for this, as the well known _locked version we have of many functions. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sat May 1 14:49:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02B4D106564A; Sat, 1 May 2010 14:49:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E584F8FC1B; Sat, 1 May 2010 14:49: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 o41EnKmJ055338; Sat, 1 May 2010 14:49:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41EnKGE055336; Sat, 1 May 2010 14:49:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005011449.o41EnKGE055336@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 1 May 2010 14:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207469 - stable/8/share/man/man1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 14:49:21 -0000 Author: jilles Date: Sat May 1 14:49:20 2010 New Revision: 207469 URL: http://svn.freebsd.org/changeset/base/207469 Log: MFC r207168: builtin(1): Add missing escaping for !, . and : in the table. This caused these commands to look differently (not bold) from the other commands in the table (bold). Modified: stable/8/share/man/man1/builtin.1 Directory Properties: stable/8/share/man/man1/ (props changed) Modified: stable/8/share/man/man1/builtin.1 ============================================================================== --- stable/8/share/man/man1/builtin.1 Sat May 1 14:46:17 2010 (r207468) +++ stable/8/share/man/man1/builtin.1 Sat May 1 14:49:20 2010 (r207469) @@ -196,10 +196,10 @@ but are implemented as scripts using a b .It Xo .Em "Command External" Ta Xr csh 1 Ta Xr sh 1 .Xc -.It Ic ! Ta \&No Ta \&No Ta Yes +.It Ic \&! Ta \&No Ta \&No Ta Yes .It Ic % Ta \&No Ta Yes Ta \&No -.It Ic . Ta \&No Ta \&No Ta Yes -.It Ic : Ta \&No Ta Yes Ta Yes +.It Ic \&. Ta \&No Ta \&No Ta Yes +.It Ic \&: Ta \&No Ta Yes Ta Yes .It Ic @ Ta \&No Ta Yes Ta Yes .It Ic \&[ Ta Yes Ta \&No Ta Yes .It Ic { Ta \&No Ta \&No Ta Yes From owner-svn-src-all@FreeBSD.ORG Sat May 1 14:49:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8CAA106564A; Sat, 1 May 2010 14:49:34 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id BC1A08FC1B; Sat, 1 May 2010 14:49:33 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so200046fge.13 for ; Sat, 01 May 2010 07:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=KibVxe6aDiATPp7FkPICdg79mdkrmgqZqhb0TEyQidk=; b=hKZGUexI5tUFzojtsJPBM4MJnCqf4flpV6+5YFlhcb/iLVszbYrPUOdatq35NwntIH f/2JMCBlgI5JX+HIaHYW6Eg783IKyBXOOHqL/uaKHRCcyqhbEhNP3UWe6UKX1HTfYQ9t SvQ2gSXUivlUWvwtjg5owoiw1m5xEzhEqurJA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=F+dcmT6jQHiGcWQF9Y/RdtHlPRZDeHhJWkwLpUDgf1jscwSzJf1prjZFVb+Ugt8mJS 4N8lovr27tbl8ZzN8mfgcjoq1kJzNCM2XLjJ12guc7ZPfWpoIqq81GI7QG7nIiZlNV/4 a/Og5b6KrxK6bXr+IdTSZ5dFFje02KUYTN53g= MIME-Version: 1.0 Received: by 10.239.142.18 with SMTP id e18mr314269hba.52.1272725365740; Sat, 01 May 2010 07:49:25 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.239.129.207 with HTTP; Sat, 1 May 2010 07:49:25 -0700 (PDT) In-Reply-To: <201005010341.o413fMhP067068@svn.freebsd.org> References: <201005010341.o413fMhP067068@svn.freebsd.org> Date: Sat, 1 May 2010 16:49:25 +0200 X-Google-Sender-Auth: L7_jm6FH3yN_Hs0GbXP4t5R9bM8 Message-ID: From: Attilio Rao To: Kip Macy Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207460 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 14:49:34 -0000 2010/5/1 Kip Macy : > Author: kmacy > Date: Sat May =C2=A01 03:41:21 2010 > New Revision: 207460 > URL: http://svn.freebsd.org/changeset/base/207460 > > Log: > =C2=A0Update locking comment above vm_page: > =C2=A0 =C2=A0 =C2=A0 =C2=A0 - re-assign page queue lock "Q" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 - assign page lock "P" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 - update several uncommented fields > =C2=A0 =C2=A0 =C2=A0 =C2=A0 - observe that hold_count is now protected by= the page lock "P" > > Modified: > =C2=A0head/sys/vm/vm_page.h > > Modified: head/sys/vm/vm_page.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/vm/vm_page.h =C2=A0 =C2=A0 =C2=A0 Sat May =C2=A01 02:53:43 2= 010 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r207459) > +++ head/sys/vm/vm_page.h =C2=A0 =C2=A0 =C2=A0 Sat May =C2=A01 03:41:21 2= 010 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r207460) > @@ -90,20 +90,21 @@ > =C2=A0* =C2=A0 =C2=A0 and sundry status bits. > =C2=A0* > =C2=A0* =C2=A0 =C2=A0 Fields in this structure are locked either by the l= ock on the > - * =C2=A0 =C2=A0 object that the page belongs to (O) or by the lock on t= he page > - * =C2=A0 =C2=A0 queues (P). > + * =C2=A0 =C2=A0 object that the page belongs to (O), its corresponding = page lock (P), > + * =C2=A0 =C2=A0 or by the lock on the page queues (Q). > + * > =C2=A0*/ > > =C2=A0TAILQ_HEAD(pglist, vm_page); > > =C2=A0struct vm_page { > - =C2=A0 =C2=A0 =C2=A0 TAILQ_ENTRY(vm_page) pageq; =C2=A0 =C2=A0 /* queue= info for FIFO queue or free list (P) */ > + =C2=A0 =C2=A0 =C2=A0 TAILQ_ENTRY(vm_page) pageq; =C2=A0 =C2=A0 /* queue= info for FIFO queue or free list (Q) */ > =C2=A0 =C2=A0 =C2=A0 =C2=A0TAILQ_ENTRY(vm_page) listq; =C2=A0 =C2=A0 /* p= ages in same object (O) =C2=A0 =C2=A0 */ > =C2=A0 =C2=A0 =C2=A0 =C2=A0struct vm_page *left; =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 /* splay tree link (O) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/ > =C2=A0 =C2=A0 =C2=A0 =C2=A0struct vm_page *right; =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0/* splay tree link (O) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/ > > - =C2=A0 =C2=A0 =C2=A0 vm_object_t object; =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 /* which object am I in (O,P)*/ > - =C2=A0 =C2=A0 =C2=A0 vm_pindex_t pindex; =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 /* offset into object (O,P) */ > + =C2=A0 =C2=A0 =C2=A0 vm_object_t object; =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 /* which object am I in (O,Q)*/ > + =C2=A0 =C2=A0 =C2=A0 vm_pindex_t pindex; =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 /* offset into object (O,Q) */ This notation is ambigous. It doesn't let understand if the lock may be held both together or not, which rules happen for reading/writing such values, etc. May you please follow well-known patterns like the tables in subr_turnstile.c ? (+ for both of them, / for one of them, clarify if it is safe to read them with just one lock of them held, etc). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sat May 1 14:57:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34F00106564A; Sat, 1 May 2010 14:57:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2398A8FC19; Sat, 1 May 2010 14:57:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o41EvaIN064668; Sat, 1 May 2010 14:57:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41EvaQn064665; Sat, 1 May 2010 14:57:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005011457.o41EvaQn064665@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 1 May 2010 14:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207470 - stable/7/share/man/man1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 14:57:36 -0000 Author: jilles Date: Sat May 1 14:57:35 2010 New Revision: 207470 URL: http://svn.freebsd.org/changeset/base/207470 Log: MFC r207166: builtin(1): Mention [ sh builtin. Modified: stable/7/share/man/man1/builtin.1 Directory Properties: stable/7/share/man/man1/ (props changed) Modified: stable/7/share/man/man1/builtin.1 ============================================================================== --- stable/7/share/man/man1/builtin.1 Sat May 1 14:49:20 2010 (r207469) +++ stable/7/share/man/man1/builtin.1 Sat May 1 14:57:35 2010 (r207470) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2006 +.Dd April 25, 2010 .Dt BUILTIN 1 .Os .Sh NAME @@ -36,6 +36,7 @@ .Nm \&. , .Nm \&: , .Nm @ , +.Nm \&[ , .Nm { , .Nm } , .Nm alias , @@ -200,6 +201,7 @@ but are implemented as scripts using a b .It Ic . Ta \&No Ta \&No Ta Yes .It Ic : Ta \&No Ta Yes Ta Yes .It Ic @ Ta \&No Ta Yes Ta Yes +.It Ic \&[ Ta Yes Ta \&No Ta Yes .It Ic { Ta \&No Ta \&No Ta Yes .It Ic } Ta \&No Ta \&No Ta Yes .It Ic alias Ta No** Ta Yes Ta Yes From owner-svn-src-all@FreeBSD.ORG Sat May 1 15:00:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA56B106566B; Sat, 1 May 2010 15:00:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E36668FC23; Sat, 1 May 2010 15:00: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 o41F00VG067519; Sat, 1 May 2010 15:00:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41F00AC067517; Sat, 1 May 2010 15:00:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005011500.o41F00AC067517@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 1 May 2010 15:00:00 +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: r207471 - stable/7/share/man/man1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 15:00:13 -0000 Author: jilles Date: Sat May 1 15:00:00 2010 New Revision: 207471 URL: http://svn.freebsd.org/changeset/base/207471 Log: MFC r207168: builtin(1): Add missing escaping for !, . and : in the table. This caused these commands to look differently (not bold) from the other commands in the table (bold). Modified: stable/7/share/man/man1/builtin.1 Directory Properties: stable/7/share/man/man1/ (props changed) Modified: stable/7/share/man/man1/builtin.1 ============================================================================== --- stable/7/share/man/man1/builtin.1 Sat May 1 14:57:35 2010 (r207470) +++ stable/7/share/man/man1/builtin.1 Sat May 1 15:00:00 2010 (r207471) @@ -196,10 +196,10 @@ but are implemented as scripts using a b .It Xo .Em "Command External" Ta Xr csh 1 Ta Xr sh 1 .Xc -.It Ic ! Ta \&No Ta \&No Ta Yes +.It Ic \&! Ta \&No Ta \&No Ta Yes .It Ic % Ta \&No Ta Yes Ta \&No -.It Ic . Ta \&No Ta \&No Ta Yes -.It Ic : Ta \&No Ta Yes Ta Yes +.It Ic \&. Ta \&No Ta \&No Ta Yes +.It Ic \&: Ta \&No Ta Yes Ta Yes .It Ic @ Ta \&No Ta Yes Ta Yes .It Ic \&[ Ta Yes Ta \&No Ta Yes .It Ic { Ta \&No Ta \&No Ta Yes From owner-svn-src-all@FreeBSD.ORG Sat May 1 15:13:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 25EEC1065672; Sat, 1 May 2010 15:13:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 96A318FC19; Sat, 1 May 2010 15:13:43 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o41FDdxI014413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 1 May 2010 18:13:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o41FDd2u049562; Sat, 1 May 2010 18:13:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o41FDdCh049561; Sat, 1 May 2010 18:13:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 1 May 2010 18:13:39 +0300 From: Kostik Belousov To: Attilio Rao Message-ID: <20100501151339.GZ2391@deviant.kiev.zoral.com.ua> References: <201005011446.o41EkIa6051907@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5FDiZl1vRbLRjwwc" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207468 - 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, 01 May 2010 15:13:44 -0000 --5FDiZl1vRbLRjwwc Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 01, 2010 at 04:47:36PM +0200, Attilio Rao wrote: > 2010/5/1 Konstantin Belousov : > > Author: kib > > Date: Sat May =9A1 14:46:17 2010 > > New Revision: 207468 > > URL: http://svn.freebsd.org/changeset/base/207468 > > > > Log: > > =9AExtract thread_lock()/ruxagg()/thread_unlock() fragment into utility > > =9Afunction ruxagg_tlock(). > > =9AConvert the definition of kern_getrusage() to ANSI C. > > >=20 > I would have preferred a different naming for this, as the well known > _locked version we have of many functions. But this is not the case there, because I did not renamed ruxagg(). It would be ruxagg()->ruxagg_unlocked() and ruxagg_tlock()->ruxagg(). I think it is better to keep existing interface of ruxagg() under the same name. Would you be interested in looking at the real patch that implements RUSAGE_THREAD ? My biggest question with the patch is I am not sure whether to apply the same checks for tu in calctru() as it is done for tu in calcru1(). Any suggestions ? diff --git a/lib/libc/sys/getrusage.2 b/lib/libc/sys/getrusage.2 index bdf5d45..423503f 100644 --- a/lib/libc/sys/getrusage.2 +++ b/lib/libc/sys/getrusage.2 @@ -28,7 +28,7 @@ .\" @(#)getrusage.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd May 1, 2010 .Dt GETRUSAGE 2 .Os .Sh NAME @@ -42,6 +42,7 @@ .In sys/resource.h .Fd "#define RUSAGE_SELF 0" .Fd "#define RUSAGE_CHILDREN -1" +.Fd "#define RUSAGE_THREAD 1" .Ft int .Fn getrusage "int who" "struct rusage *rusage" .Sh DESCRIPTION @@ -49,11 +50,12 @@ The .Fn getrusage system call returns information describing the resources utilized by the current -process, or all its terminated child processes. +thread, the current process, or all its terminated child processes. The .Fa who argument is either -.Dv RUSAGE_SELF +.Dv RUSAGE_THREAD , +.Dv RUSAGE_SELF , or .Dv RUSAGE_CHILDREN . The buffer to which @@ -175,6 +177,10 @@ The .Fn getrusage system call appeared in .Bx 4.2 . +The +.Dv RUSAGE_THREAD +facility first appeared in +.Fx 8.1 . .Sh BUGS There is no way to obtain information about a child process that has not yet terminated. diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index a3ed75d..8e7fdb6 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -921,6 +921,31 @@ calcru1(struct proc *p, struct rusage_ext *ruxp, struc= t timeval *up, sp->tv_usec =3D su % 1000000; } =20 +static void +calctru(struct thread *td) +{ + /* {user, system, interrupt, total} {ticks, usec}: */ + u_int64_t ut, uu, st, su, it, tt, tu; + + tu =3D cputick2usec(td->td_incruntime); + ut =3D td->td_uticks; + it =3D td->td_iticks; + st =3D td->td_sticks; + + tt =3D ut + st + it; + if (tt =3D=3D 0) { + /* Avoid divide by zero */ + st =3D 1; + tt =3D 1; + } + uu =3D td->td_ru.ru_utime.tv_usec + (ut * tu) / tt; + su =3D td->td_ru.ru_stime.tv_usec + (st * tu) / tt; + td->td_ru.ru_utime.tv_sec +=3D uu / 1000000; + td->td_ru.ru_utime.tv_usec =3D uu % 1000000; + td->td_ru.ru_stime.tv_sec +=3D su / 1000000; + td->td_ru.ru_stime.tv_usec =3D su % 1000000; +} + #ifndef _SYS_SYSPROTO_H_ struct getrusage_args { int who; @@ -961,6 +986,13 @@ kern_getrusage(struct thread *td, int who, struct rusa= ge *rup) calccru(p, &rup->ru_utime, &rup->ru_stime); break; =20 + case RUSAGE_THREAD: + PROC_SLOCK(p); + ruxagg_tlock(p, td); + PROC_SUNLOCK(p); + *rup =3D td->td_ru; + break; + default: error =3D EINVAL; } @@ -1010,6 +1042,12 @@ ruxagg(struct rusage_ext *rux, struct thread *td) rux->rux_uticks +=3D td->td_uticks; rux->rux_sticks +=3D td->td_sticks; rux->rux_iticks +=3D td->td_iticks; + + /* + * Update thread rusage before ticks counters cleaning. + */ + calctru(td); + td->td_incruntime =3D 0; td->td_uticks =3D 0; td->td_iticks =3D 0; diff --git a/sys/sys/resource.h b/sys/sys/resource.h index 9af96af..e703744 100644 --- a/sys/sys/resource.h +++ b/sys/sys/resource.h @@ -56,6 +56,7 @@ =20 #define RUSAGE_SELF 0 #define RUSAGE_CHILDREN -1 +#define RUSAGE_THREAD 1 =20 struct rusage { struct timeval ru_utime; /* user time used */ --5FDiZl1vRbLRjwwc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkvcRSMACgkQC3+MBN1Mb4gaJgCfcFfnsXx/02CVW6aIagvi1iyr OUoAmwRdIi7b9TNhd7m1vXQc5N1KeDMV =Egi5 -----END PGP SIGNATURE----- --5FDiZl1vRbLRjwwc-- From owner-svn-src-all@FreeBSD.ORG Sat May 1 15:41:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A00C1065674; Sat, 1 May 2010 15:41:54 +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 3330E8FC0A; Sat, 1 May 2010 15:41:53 +0000 (UTC) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 5A18B2C2ADC; Sat, 1 May 2010 10:41:53 -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 azEeEpg8B7CF; Sat, 1 May 2010 10:41:45 -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 478362C2AD0; Sat, 1 May 2010 10:41:45 -0500 (CDT) Message-ID: <4BDC4BB8.3000307@cs.rice.edu> Date: Sat, 01 May 2010 10:41:44 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100327) MIME-Version: 1.0 To: Kip Macy References: <201004302120.o3ULKEar083168@svn.freebsd.org> In-Reply-To: <201004302120.o3ULKEar083168@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207450 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 15:41:54 -0000 Kip Macy wrote: > Author: kmacy > Date: Fri Apr 30 21:20:14 2010 > New Revision: 207450 > URL: http://svn.freebsd.org/changeset/base/207450 > > Log: > - acquire the page lock in vm_contig_launder_page before checking page fields > - release page queue lock before calling vm_pageout_flush > > This change introduces a race condition. Between dropping the page queues lock in vm_contig_launder() and reacquiring it in vm_contig_launder_page(), the page may be removed from the inactive queue. It could be wired, freed, cached, etc. None of which vm_contig_launder_page() is prepared for. You need to call vm_contig_launder_page with the page queues lock held, like before, and deal with the lock order reversal just like the page daemon does in vm_pageout_scan(). In fact, notice that the lock order reversal with the object lock uses a function from vm_pageout.c. Regards, Alan > Modified: > head/sys/vm/vm_contig.c > > Modified: head/sys/vm/vm_contig.c > ============================================================================== > --- head/sys/vm/vm_contig.c Fri Apr 30 19:52:35 2010 (r207449) > +++ head/sys/vm/vm_contig.c Fri Apr 30 21:20:14 2010 (r207450) > @@ -96,30 +96,33 @@ vm_contig_launder_page(vm_page_t m, vm_p > vm_page_t m_tmp; > struct vnode *vp; > struct mount *mp; > - int vfslocked; > + int vfslocked, dirty; > > - mtx_assert(&vm_page_queue_mtx, MA_OWNED); > + vm_page_lock(m); > + vm_page_lock_queues(); > object = m->object; > if (!VM_OBJECT_TRYLOCK(object) && > !vm_pageout_fallback_object_lock(m, next)) { > VM_OBJECT_UNLOCK(object); > + vm_page_unlock_queues(); > + vm_page_unlock(m); > return (EAGAIN); > } > if (vm_page_sleep_if_busy(m, TRUE, "vpctw0")) { > VM_OBJECT_UNLOCK(object); > - vm_page_lock_queues(); > return (EBUSY); > } > vm_page_test_dirty(m); > if (m->dirty == 0 && m->hold_count == 0) > pmap_remove_all(m); > - if (m->dirty) { > + if ((dirty = m->dirty) != 0) { > + vm_page_unlock_queues(); > + vm_page_unlock(m); > if ((object->flags & OBJ_DEAD) != 0) { > VM_OBJECT_UNLOCK(object); > return (EAGAIN); > } > if (object->type == OBJT_VNODE) { > - vm_page_unlock_queues(); > vp = object->handle; > vm_object_reference_locked(object); > VM_OBJECT_UNLOCK(object); > @@ -133,7 +136,6 @@ vm_contig_launder_page(vm_page_t m, vm_p > VFS_UNLOCK_GIANT(vfslocked); > vm_object_deallocate(object); > vn_finished_write(mp); > - vm_page_lock_queues(); > return (0); > } else if (object->type == OBJT_SWAP || > object->type == OBJT_DEFAULT) { > @@ -144,6 +146,11 @@ vm_contig_launder_page(vm_page_t m, vm_p > } > } else if (m->hold_count == 0) > vm_page_cache(m); > + > + if (dirty == 0) { > + vm_page_unlock_queues(); > + vm_page_unlock(m); > + } > VM_OBJECT_UNLOCK(object); > return (0); > } > @@ -162,7 +169,9 @@ vm_contig_launder(int queue) > > KASSERT(VM_PAGE_INQUEUE2(m, queue), > ("vm_contig_launder: page %p's queue is not %d", m, queue)); > + vm_page_unlock_queues(); > error = vm_contig_launder_page(m, &next); > + vm_page_lock_queues(); > if (error == 0) > return (TRUE); > if (error == EBUSY) > From owner-svn-src-all@FreeBSD.ORG Sat May 1 16:36:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D234106566B; Sat, 1 May 2010 16:36:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 51D778FC12; Sat, 1 May 2010 16:36: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 o41GaFDS084348; Sat, 1 May 2010 16:36:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41GaFsK084343; Sat, 1 May 2010 16:36:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201005011636.o41GaFsK084343@svn.freebsd.org> From: Warner Losh Date: Sat, 1 May 2010 16:36: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: r207472 - in head/sys: conf dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 16:36:15 -0000 Author: imp Date: Sat May 1 16:36:14 2010 New Revision: 207472 URL: http://svn.freebsd.org/changeset/base/207472 Log: The Atheros AR71xx CPUs, when paired with the AR5212 parts, has a bug that generates a fatal bus trap. Normally, the chips are setup to do 128 byte DMA bursts, but when on this CPU, they can only safely due 4-byte DMA bursts due to this bug. Details of the exact nature of the bug are sketchy, but some can be found at https://forum.openwrt.org/viewtopic.php?pid=70060 on pages 4, 5 and 6. There's a small performance penalty associated with this workaround, so it is only enabled when needed on the Atheros AR71xx platforms. Unfortunately, this condition is impossible to detect at runtime without MIPS specific ifdefs. Rather than cast an overly-broad net like Linux/OpenWRT dues (which enables this workaround all the time on MIPS32 platforms), we put this option in the kernel for just the affected machines. Sam didn't like this aspect of the patch when he reviewed it, and I'd love to hear sane proposals on how to fix it :) Reviewed by: sam@ Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat May 1 15:00:00 2010 (r207471) +++ head/sys/conf/NOTES Sat May 1 16:36:14 2010 (r207472) @@ -2091,6 +2091,15 @@ device ath_hal # pci/cardbus chip supp #device ath_rf5413 #device ath_ar5416 # AR5416 chips options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors +# All of the AR5212 parts have a problem when paired with the AR71xx +# CPUS. These parts have a bug that triggers a fatal bus error on the AR71xx +# only. Details of the exact nature of the bug are sketchy, but some can be +# found at https://forum.openwrt.org/viewtopic.php?pid=70060 on pages 4, 5 and +# 6. This option enables this workaround. There is a performance penalty +# for this work around, but without it things don't work at all. The DMA +# from the card usually bursts 128 bytes, but on the affected CPUs, only +# 4 are safe. +options AH_RXCFG_SDMAMW_4BYTES #device ath_ar9160 # AR9160 chips #device ath_ar9280 # AR9280 chips #device ath_ar9285 # AR9285 chips Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat May 1 15:00:00 2010 (r207471) +++ head/sys/conf/options Sat May 1 16:36:14 2010 (r207472) @@ -771,6 +771,7 @@ AH_PRIVATE_DIAG opt_ah.h AH_NEED_DESC_SWAP opt_ah.h AH_USE_INIPDGAIN opt_ah.h AH_MAXCHAN opt_ah.h +AH_RXCFG_SDMAMW_4BYTES opt_ah.h # options for the Broadcom BCM43xx driver (bwi) BWI_DEBUG opt_bwi.h Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Sat May 1 15:00:00 2010 (r207471) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Sat May 1 16:36:14 2010 (r207472) @@ -283,6 +283,14 @@ ar5212Reset(struct ath_hal *ah, HAL_OPMO regWrites = ath_hal_ini_write(ah, &ahp->ah_ini_modes, modesIndex, 0); regWrites = write_common(ah, &ahp->ah_ini_common, bChannelChange, regWrites); +#ifdef AH_RXCFG_SDMAMW_4BYTES + /* + * Nala doesn't work with 128 byte bursts on pb42(hydra) (ar71xx), + * use 4 instead. Enabling it on all platforms would hurt performance, + * so we only enable it on the ones that are affected by it. + */ + OS_REG_WRITE(ah, AR_RXCFG, 0); +#endif ahp->ah_rfHal->writeRegs(ah, modesIndex, freqIndex, regWrites); OS_MARK(ah, AH_MARK_RESET_LINE, __LINE__); From owner-svn-src-all@FreeBSD.ORG Sat May 1 16:38:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A30A1065674; Sat, 1 May 2010 16:38:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2A37F8FC18; Sat, 1 May 2010 16:38: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 o41GcfOE087263; Sat, 1 May 2010 16:38:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41GcfWl087258; Sat, 1 May 2010 16:38:41 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201005011638.o41GcfWl087258@svn.freebsd.org> From: Warner Losh Date: Sat, 1 May 2010 16:38: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: r207473 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 16:38:41 -0000 Author: imp Date: Sat May 1 16:38:40 2010 New Revision: 207473 URL: http://svn.freebsd.org/changeset/base/207473 Log: Put the -current debugging options back into AR71XX. Modified: head/sys/mips/conf/AR71XX Modified: head/sys/mips/conf/AR71XX ============================================================================== --- head/sys/mips/conf/AR71XX Sat May 1 16:36:14 2010 (r207472) +++ head/sys/mips/conf/AR71XX Sat May 1 16:38:40 2010 (r207473) @@ -29,11 +29,11 @@ options _KPOSIX_PRIORITY_SCHEDULING #Po # options NFS_LEGACYRPC # Debugging for use in -current -# options DEADLKRES -# options INVARIANTS -# options INVARIANT_SUPPORT -# options WITNESS -# options WITNESS_SKIPSPIN +options DEADLKRES +options INVARIANTS +options INVARIANT_SUPPORT +options WITNESS +options WITNESS_SKIPSPIN options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists From owner-svn-src-all@FreeBSD.ORG Sat May 1 16:39:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5102D106564A; Sat, 1 May 2010 16:39:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 412258FC1A; Sat, 1 May 2010 16:39:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o41GdlMo088665; Sat, 1 May 2010 16:39:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41GdlVS088661; Sat, 1 May 2010 16:39:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201005011639.o41GdlVS088661@svn.freebsd.org> From: Warner Losh Date: Sat, 1 May 2010 16:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207474 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 16:39:47 -0000 Author: imp Date: Sat May 1 16:39:46 2010 New Revision: 207474 URL: http://svn.freebsd.org/changeset/base/207474 Log: Enable AH_RXCFG_SDMAMW_4BYTES option. See NOTES file for why this is workaround (WAR) is needed. Modified: head/sys/mips/conf/AR71XX Modified: head/sys/mips/conf/AR71XX ============================================================================== --- head/sys/mips/conf/AR71XX Sat May 1 16:38:40 2010 (r207473) +++ head/sys/mips/conf/AR71XX Sat May 1 16:39:46 2010 (r207474) @@ -62,6 +62,7 @@ device ath # Atheros pci/ca options ATH_DEBUG device ath_hal option AH_SUPPORT_AR5416 +option AH_RXCFG_SDMAMW_4BYTES # See NOTES for details of this WAR device ath_rate_sample device mii From owner-svn-src-all@FreeBSD.ORG Sat May 1 18:34:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFDD21065686; Sat, 1 May 2010 18:34:50 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D03018FC1B; Sat, 1 May 2010 18:34: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 o41IYoKY028459; Sat, 1 May 2010 18:34:50 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41IYoRJ028457; Sat, 1 May 2010 18:34:50 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <201005011834.o41IYoRJ028457@svn.freebsd.org> From: Marko Zec Date: Sat, 1 May 2010 18:34: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: r207475 - 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, 01 May 2010 18:34:51 -0000 Author: zec Date: Sat May 1 18:34:50 2010 New Revision: 207475 URL: http://svn.freebsd.org/changeset/base/207475 Log: Remove a redundant variable assignment. Reviewed by: bz, rwatson MFC after: 3 days Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sat May 1 16:39:46 2010 (r207474) +++ head/sys/kern/uipc_mbuf.c Sat May 1 18:34:50 2010 (r207475) @@ -948,9 +948,8 @@ m_adj(struct mbuf *mp, int req_len) len = 0; } } - m = mp; if (mp->m_flags & M_PKTHDR) - m->m_pkthdr.len -= (req_len - len); + mp->m_pkthdr.len -= (req_len - len); } else { /* * Trim from tail. Scan the mbuf chain, From owner-svn-src-all@FreeBSD.ORG Sat May 1 18:56:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 45AE4106564A; Sat, 1 May 2010 18:56:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 35BF48FC20; Sat, 1 May 2010 18:56: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 o41Iujff055887; Sat, 1 May 2010 18:56:45 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41Iuj6o055885; Sat, 1 May 2010 18:56:45 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201005011856.o41Iuj6o055885@svn.freebsd.org> From: Ed Maste Date: Sat, 1 May 2010 18:56: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: r207476 - head/lib/libufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 18:56:46 -0000 Author: emaste Date: Sat May 1 18:56:45 2010 New Revision: 207476 URL: http://svn.freebsd.org/changeset/base/207476 Log: Search beyond the first 1/8th of inodes. Submitted by: jeff Modified: head/lib/libufs/cgroup.c Modified: head/lib/libufs/cgroup.c ============================================================================== --- head/lib/libufs/cgroup.c Sat May 1 18:34:50 2010 (r207475) +++ head/lib/libufs/cgroup.c Sat May 1 18:56:45 2010 (r207476) @@ -145,7 +145,7 @@ cgialloc(struct uufsd *disk) fs = &disk->d_fs; cgp = &disk->d_cg; inosused = cg_inosused(cgp); - for (ino = 0; ino < fs->fs_ipg / NBBY; ino++) + for (ino = 0; ino < fs->fs_ipg; ino++) if (isclr(inosused, ino)) goto gotit; return (0); From owner-svn-src-all@FreeBSD.ORG Sat May 1 19:00:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2D191065672; Sat, 1 May 2010 19:00:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id B11978FC1C; Sat, 1 May 2010 19:00: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 o41J0XtO060781; Sat, 1 May 2010 19:00:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41J0XZT060777; Sat, 1 May 2010 19:00:33 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201005011900.o41J0XZT060777@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 1 May 2010 19:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207477 - 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: Sat, 01 May 2010 19:00:33 -0000 Author: pjd Date: Sat May 1 19:00:33 2010 New Revision: 207477 URL: http://svn.freebsd.org/changeset/base/207477 Log: MFC r207068,r207334: r207068: Allow to modify directory's content even if the ZFS_NOUNLINK (SF_NOUNLINK, sunlnk) flag is set. We only deny dirctory's removal or rename. PR: kern/143343 Reported by: marck r207334: Backport fix for 'zfs_znode_dmu_init: existing znode for dbuf' panic from OpenSolaris. PR: kern/144402 Reported by: Alex Bakhtin Tested by: Alex Bakhtin Obtained from: OpenSolaris, Bug ID 6895088 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sat May 1 18:56:45 2010 (r207476) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sat May 1 19:00:33 2010 (r207477) @@ -2235,11 +2235,24 @@ zfs_zaccess_common(znode_t *zp, uint32_t return (EPERM); } +#ifdef sun if ((v4_mode & (ACE_DELETE | ACE_DELETE_CHILD)) && (zp->z_phys->zp_flags & ZFS_NOUNLINK)) { *check_privs = B_FALSE; return (EPERM); } +#else + /* + * In FreeBSD we allow to modify directory's content is ZFS_NOUNLINK + * (sunlnk) is set. We just don't allow directory removal, which is + * handled in zfs_zaccess_delete(). + */ + if ((v4_mode & ACE_DELETE) && + (zp->z_phys->zp_flags & ZFS_NOUNLINK)) { + *check_privs = B_FALSE; + return (EPERM); + } +#endif if (((v4_mode & (ACE_READ_DATA|ACE_EXECUTE)) && (zp->z_phys->zp_flags & ZFS_AV_QUARANTINED))) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat May 1 18:56:45 2010 (r207476) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat May 1 19:00:33 2010 (r207477) @@ -704,6 +704,8 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d DMU_OT_ZNODE, sizeof (znode_phys_t) + bonuslen, tx); } } + + ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); VERIFY(0 == dmu_bonus_hold(zfsvfs->z_os, obj, NULL, &db)); dmu_buf_will_dirty(db, tx); @@ -765,9 +767,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d pzp->zp_mode = MAKEIMODE(vap->va_type, vap->va_mode); if (!(flag & IS_ROOT_NODE)) { - ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); *zpp = zfs_znode_alloc(zfsvfs, db, 0); - ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); } else { /* * If we are creating the root node, the "parent" we @@ -776,6 +776,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d *zpp = dzp; } zfs_perm_init(*zpp, dzp, flag, vap, tx, cr, setaclp, fuidp); + ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); if (!(flag & IS_ROOT_NODE)) { vnode_t *vp; @@ -939,19 +940,31 @@ again: /* * Not found create new znode/vnode + * but only if file exists. + * + * There is a small window where zfs_vget() could + * find this object while a file create is still in + * progress. Since a gen number can never be zero + * we will check that to determine if its an allocated + * file. */ - zp = zfs_znode_alloc(zfsvfs, db, doi.doi_data_block_size); - - vp = ZTOV(zp); - vp->v_vflag |= VV_FORCEINSMQ; - err = insmntque(vp, zfsvfs->z_vfs); - vp->v_vflag &= ~VV_FORCEINSMQ; - KASSERT(err == 0, ("insmntque() failed: error %d", err)); - VOP_UNLOCK(vp, 0); + if (((znode_phys_t *)db->db_data)->zp_gen != 0) { + zp = zfs_znode_alloc(zfsvfs, db, doi.doi_data_block_size); + *zpp = zp; + vp = ZTOV(zp); + vp->v_vflag |= VV_FORCEINSMQ; + err = insmntque(vp, zfsvfs->z_vfs); + vp->v_vflag &= ~VV_FORCEINSMQ; + KASSERT(err == 0, ("insmntque() failed: error %d", err)); + VOP_UNLOCK(vp, 0); + err = 0; + } else { + dmu_buf_rele(db, NULL); + err = ENOENT; + } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); - *zpp = zp; - return (0); + return (err); } int @@ -1440,6 +1453,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, uint64_t norm = 0; nvpair_t *elem; int error; + int i; znode_t *rootzp = NULL; vnode_t vnode; vattr_t vattr; @@ -1537,6 +1551,9 @@ zfs_create_fs(objset_t *os, cred_t *cr, list_create(&zfsvfs.z_all_znodes, sizeof (znode_t), offsetof(znode_t, z_link_node)); + for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) + mutex_init(&zfsvfs.z_hold_mtx[i], NULL, MUTEX_DEFAULT, NULL); + ASSERT(!POINTER_IS_VALID(rootzp->z_zfsvfs)); rootzp->z_zfsvfs = &zfsvfs; zfs_mknode(rootzp, &vattr, tx, cr, IS_ROOT_NODE, &zp, 0, NULL, NULL); @@ -1547,6 +1564,8 @@ zfs_create_fs(objset_t *os, cred_t *cr, dmu_buf_rele(rootzp->z_dbuf, NULL); rootzp->z_dbuf = NULL; + for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) + mutex_destroy(&zfsvfs.z_hold_mtx[i]); mutex_destroy(&zfsvfs.z_znodes_lock); rootzp->z_vnode = NULL; kmem_cache_free(znode_cache, rootzp); From owner-svn-src-all@FreeBSD.ORG Sat May 1 19:12:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC8081065670; Sat, 1 May 2010 19:12:37 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9BEF88FC0A; Sat, 1 May 2010 19:12: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 o41JCbNr075273; Sat, 1 May 2010 19:12:37 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41JCbxS075271; Sat, 1 May 2010 19:12:37 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201005011912.o41JCbxS075271@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 1 May 2010 19:12: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: r207478 - stable/8/sbin/hastctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 19:12:37 -0000 Author: pjd Date: Sat May 1 19:12:37 2010 New Revision: 207478 URL: http://svn.freebsd.org/changeset/base/207478 Log: MFC r207070: Fix compilation with WITHOUT_CRYPT or WITHOUT_OPENSSL options. Reported by: Andrei V. Lavreniyuk Modified: stable/8/sbin/hastctl/Makefile Directory Properties: stable/8/sbin/hastctl/ (props changed) Modified: stable/8/sbin/hastctl/Makefile ============================================================================== --- stable/8/sbin/hastctl/Makefile Sat May 1 19:00:33 2010 (r207477) +++ stable/8/sbin/hastctl/Makefile Sat May 1 19:12:37 2010 (r207478) @@ -26,8 +26,13 @@ CFLAGS+=-DINET6 # This is needed to have WARNS > 1. CFLAGS+=-DYY_NO_UNPUT -DPADD= ${LIBCRYPTO} ${LIBL} -LDADD= -lcrypto -ll +DPADD= ${LIBL} +LDADD= -ll +.if ${MK_OPENSSL} != "no" +DPADD+= ${LIBCRYPTO} +LDADD+= -lcrypto +CFLAGS+=-DHAVE_CRYPTO +.endif YFLAGS+=-v From owner-svn-src-all@FreeBSD.ORG Sat May 1 19:16:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7125C1065688; Sat, 1 May 2010 19:16:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5F57C8FC18; Sat, 1 May 2010 19:16:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o41JG9q6079720; Sat, 1 May 2010 19:16:09 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41JG9ka079702; Sat, 1 May 2010 19:16:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201005011916.o41JG9ka079702@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 1 May 2010 19:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207479 - stable/8/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 19:16:09 -0000 Author: pjd Date: Sat May 1 19:16:08 2010 New Revision: 207479 URL: http://svn.freebsd.org/changeset/base/207479 Log: MFC r207070,r207343,r207345,r207347,r207348,r207371,r207372,r207390: r207070: Fix compilation with WITHOUT_CRYPT or WITHOUT_OPENSSL options. Reported by: Andrei V. Lavreniyuk r207343: Don't assume that "resource" property is in metadata. Reported by: Mikolaj Golub r207345: Use WEXITSTATUS() to obtain real exit code. r207347: Mark temporary issues as such. r207348: Restart worker thread only if the problem was temporary. In case of persistent problem we don't want to loop forever. r207371: Fix a problem where hastd will stuck in recv(2) after sending request to secondary, which died between send(2) and recv(2). Do it by adding timeout to recv(2) for primary incoming and outgoing sockets and secondary outgoing socket. Reported by: Mikolaj Golub Tested by: Mikolaj Golub r207372: - Check if the worker process was killed by signal and restart it. - Improve logging. Pointed out by: Garrett Cooper r207390: Default connection timeout is way too long. To make it shorter we have to make socket non-blocking, connect() and if we get EINPROGRESS, we have to wait using select(). Very complex, but I know no other way to define connection timeout for a given socket. Reported by: hiroshi@soupacific.com Modified: stable/8/sbin/hastd/Makefile stable/8/sbin/hastd/hast.conf.5 stable/8/sbin/hastd/hast.h stable/8/sbin/hastd/hast_proto.c stable/8/sbin/hastd/hastd.c stable/8/sbin/hastd/metadata.c stable/8/sbin/hastd/parse.y stable/8/sbin/hastd/primary.c stable/8/sbin/hastd/proto.c stable/8/sbin/hastd/proto.h stable/8/sbin/hastd/proto_common.c stable/8/sbin/hastd/proto_tcp4.c stable/8/sbin/hastd/secondary.c stable/8/sbin/hastd/token.l Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/Makefile ============================================================================== --- stable/8/sbin/hastd/Makefile Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/Makefile Sat May 1 19:16:08 2010 (r207479) @@ -27,9 +27,13 @@ CFLAGS+=-DINET6 # This is needed to have WARNS > 1. CFLAGS+=-DYY_NO_UNPUT -DPADD= ${LIBCRYPTO} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} \ - ${LIBPTHREAD} ${LIBUTIL} -LDADD= -lcrypto -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil +DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} +LDADD= -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil +.if ${MK_OPENSSL} != "no" +DPADD+= ${LIBCRYPTO} +LDADD+= -lcrypto +CFLAGS+=-DHAVE_CRYPTO +.endif YFLAGS+=-v Modified: stable/8/sbin/hastd/hast.conf.5 ============================================================================== --- stable/8/sbin/hastd/hast.conf.5 Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/hast.conf.5 Sat May 1 19:16:08 2010 (r207479) @@ -58,6 +58,7 @@ file is following: control listen replication +timeout on { # Node section @@ -76,6 +77,7 @@ resource { replication name local + timeout on { # Resource-node section @@ -194,6 +196,11 @@ The .Ic async replication mode is currently not implemented. .El +.It Ic timeout Aq seconds +.Pp +Connection timeout in seconds. +The default value is +.Va 5 . .It Ic name Aq name .Pp GEOM provider name that will appear as Modified: stable/8/sbin/hastd/hast.h ============================================================================== --- stable/8/sbin/hastd/hast.h Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/hast.h Sat May 1 19:16:08 2010 (r207479) @@ -75,6 +75,7 @@ #define HIO_DELETE 3 #define HIO_FLUSH 4 +#define HAST_TIMEOUT 5 #define HAST_CONFIG "/etc/hast.conf" #define HAST_CONTROL "/var/run/hastctl" #define HASTD_PORT 8457 @@ -148,6 +149,8 @@ struct hast_resource { /* Token to verify both in and out connection are coming from the same node (not necessarily from the same address). */ unsigned char hr_token[HAST_TOKEN_SIZE]; + /* Connection timeout. */ + int hr_timeout; /* Resource unique identifier. */ uint64_t hr_resuid; Modified: stable/8/sbin/hastd/hast_proto.c ============================================================================== --- stable/8/sbin/hastd/hast_proto.c Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/hast_proto.c Sat May 1 19:16:08 2010 (r207479) @@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef HAVE_CRYPTO #include +#endif #include #include @@ -67,14 +69,18 @@ static int compression_send(struct hast_ void **datap, size_t *sizep, bool *freedatap); static int compression_recv(struct hast_resource *res, struct nv *nv, void **datap, size_t *sizep, bool *freedatap); +#ifdef HAVE_CRYPTO static int checksum_send(struct hast_resource *res, struct nv *nv, void **datap, size_t *sizep, bool *freedatap); static int checksum_recv(struct hast_resource *res, struct nv *nv, void **datap, size_t *sizep, bool *freedatap); +#endif static struct hast_pipe_stage pipeline[] = { { "compression", compression_send, compression_recv }, +#ifdef HAVE_CRYPTO { "checksum", checksum_send, checksum_recv } +#endif }; static int @@ -161,6 +167,7 @@ compression_recv(struct hast_resource *r return (0); } +#ifdef HAVE_CRYPTO static int checksum_send(struct hast_resource *res, struct nv *nv, void **datap, size_t *sizep, bool *freedatap __unused) @@ -221,6 +228,7 @@ checksum_recv(struct hast_resource *res, return (0); } +#endif /* HAVE_CRYPTO */ /* * Send the given nv structure via conn. Modified: stable/8/sbin/hastd/hastd.c ============================================================================== --- stable/8/sbin/hastd/hastd.c Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/hastd.c Sat May 1 19:16:08 2010 (r207479) @@ -108,6 +108,22 @@ g_gate_load(void) } static void +child_exit_log(unsigned int pid, int status) +{ + + if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { + pjdlog_debug(1, "Worker process exited gracefully (pid=%u).", + pid); + } else if (WIFSIGNALED(status)) { + pjdlog_error("Worker process killed (pid=%u, signal=%d).", + pid, WTERMSIG(status)); + } else { + pjdlog_error("Worker process exited ungracefully (pid=%u, exitcode=%d).", + pid, WIFEXITED(status) ? WEXITSTATUS(status) : -1); + } +} + +static void child_exit(void) { struct hast_resource *res; @@ -129,20 +145,25 @@ child_exit(void) } pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); - if (WEXITSTATUS(status) == 0) { - pjdlog_debug(1, - "Worker process exited gracefully (pid=%u).", - (unsigned int)pid); - } else { - pjdlog_error("Worker process failed (pid=%u, status=%d).", - (unsigned int)pid, WEXITSTATUS(status)); - } + child_exit_log(pid, status); proto_close(res->hr_ctrl); res->hr_workerpid = 0; if (res->hr_role == HAST_ROLE_PRIMARY) { - sleep(1); - pjdlog_info("Restarting worker process."); - hastd_primary(res); + /* + * Restart child process if it was killed by signal + * or exited because of temporary problem. + */ + if (WIFSIGNALED(status) || + (WIFEXITED(status) && + WEXITSTATUS(status) == EX_TEMPFAIL)) { + sleep(1); + pjdlog_info("Restarting worker process."); + hastd_primary(res); + } else { + res->hr_role = HAST_ROLE_INIT; + pjdlog_info("Changing resource role back to %s.", + role2str(res->hr_role)); + } } pjdlog_prefix_set("%s", ""); } @@ -181,6 +202,10 @@ listen_accept(void) proto_remote_address(conn, raddr, sizeof(raddr)); pjdlog_info("Connection from %s to %s.", laddr, raddr); + /* Error in setting timeout is not critical, but why should it fail? */ + if (proto_timeout(conn, HAST_TIMEOUT) < 0) + pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); + nvin = nvout = nverr = NULL; /* @@ -290,18 +315,12 @@ listen_accept(void) /* Wait for it to exit. */ else if ((pid = waitpid(res->hr_workerpid, &status, 0)) != res->hr_workerpid) { + /* We can only log the problem. */ pjdlog_errno(LOG_ERR, "Waiting for worker process (pid=%u) failed", (unsigned int)res->hr_workerpid); - /* See above. */ - } else if (status != 0) { - pjdlog_error("Worker process (pid=%u) exited ungracefully: status=%d.", - (unsigned int)res->hr_workerpid, status); - /* See above. */ } else { - pjdlog_debug(1, - "Worker process (pid=%u) exited gracefully.", - (unsigned int)res->hr_workerpid); + child_exit_log(res->hr_workerpid, status); } res->hr_workerpid = 0; } else if (res->hr_remotein != NULL) { Modified: stable/8/sbin/hastd/metadata.c ============================================================================== --- stable/8/sbin/hastd/metadata.c Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/metadata.c Sat May 1 19:16:08 2010 (r207479) @@ -117,7 +117,7 @@ metadata_read(struct hast_resource *res, } str = nv_get_string(nv, "resource"); - if (strcmp(str, res->hr_name) != 0) { + if (str != NULL && strcmp(str, res->hr_name) != 0) { pjdlog_error("Provider %s is not part of resource %s.", res->hr_localpath, res->hr_name); nv_free(nv); Modified: stable/8/sbin/hastd/parse.y ============================================================================== --- stable/8/sbin/hastd/parse.y Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/parse.y Sat May 1 19:16:08 2010 (r207479) @@ -58,6 +58,7 @@ static bool mynode; static char depth0_control[HAST_ADDRSIZE]; static char depth0_listen[HAST_ADDRSIZE]; static int depth0_replication; +static int depth0_timeout; static char depth1_provname[PATH_MAX]; static char depth1_localpath[PATH_MAX]; @@ -115,6 +116,7 @@ yy_config_parse(const char *config) curres = NULL; mynode = false; + depth0_timeout = HAST_TIMEOUT; depth0_replication = HAST_REPLICATION_MEMSYNC; strlcpy(depth0_control, HAST_CONTROL, sizeof(depth0_control)); strlcpy(depth0_listen, HASTD_LISTEN, sizeof(depth0_listen)); @@ -154,6 +156,13 @@ yy_config_parse(const char *config) */ curres->hr_replication = depth0_replication; } + if (curres->hr_timeout == -1) { + /* + * Timeout is not set at resource-level. + * Use global or default setting. + */ + curres->hr_timeout = depth0_timeout; + } } return (&lconfig); @@ -171,7 +180,7 @@ yy_config_free(struct hastd_config *conf } %} -%token CONTROL LISTEN PORT REPLICATION EXTENTSIZE RESOURCE NAME LOCAL REMOTE ON +%token CONTROL LISTEN PORT REPLICATION TIMEOUT EXTENTSIZE RESOURCE NAME LOCAL REMOTE ON %token FULLSYNC MEMSYNC ASYNC %token NUM STR OB CB @@ -200,6 +209,8 @@ statement: | replication_statement | + timeout_statement + | node_statement | resource_statement @@ -281,6 +292,22 @@ replication_type: ASYNC { $$ = HAST_REPLICATION_ASYNC; } ; +timeout_statement: TIMEOUT NUM + { + switch (depth) { + case 0: + depth0_timeout = $2; + break; + case 1: + if (curres != NULL) + curres->hr_timeout = $2; + break; + default: + assert(!"timeout at wrong depth level"); + } + } + ; + node_statement: ON node_start OB node_entries CB { mynode = false; @@ -389,6 +416,7 @@ resource_start: STR curres->hr_role = HAST_ROLE_INIT; curres->hr_previous_role = HAST_ROLE_INIT; curres->hr_replication = -1; + curres->hr_timeout = -1; curres->hr_provname[0] = '\0'; curres->hr_localpath[0] = '\0'; curres->hr_localfd = -1; @@ -405,6 +433,8 @@ resource_entries: resource_entry: replication_statement | + timeout_statement + | name_statement | local_statement Modified: stable/8/sbin/hastd/primary.c ============================================================================== --- stable/8/sbin/hastd/primary.c Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/primary.c Sat May 1 19:16:08 2010 (r207479) @@ -480,7 +480,7 @@ init_remote(struct hast_resource *res, s /* Prepare outgoing connection with remote node. */ if (proto_client(res->hr_remoteaddr, &out) < 0) { - primary_exit(EX_OSERR, "Unable to create connection to %s", + primary_exit(EX_TEMPFAIL, "Unable to create connection to %s", res->hr_remoteaddr); } /* Try to connect, but accept failure. */ @@ -489,6 +489,9 @@ init_remote(struct hast_resource *res, s res->hr_remoteaddr); goto close; } + /* Error in setting timeout is not critical, but why should it fail? */ + if (proto_timeout(out, res->hr_timeout) < 0) + pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); /* * First handshake step. * Setup outgoing connection with remote node. @@ -552,6 +555,9 @@ init_remote(struct hast_resource *res, s res->hr_remoteaddr); goto close; } + /* Error in setting timeout is not critical, but why should it fail? */ + if (proto_timeout(in, res->hr_timeout) < 0) + pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); nvout = nv_alloc(); nv_add_string(nvout, res->hr_name, "resource"); nv_add_uint8_array(nvout, res->hr_token, sizeof(res->hr_token), @@ -739,7 +745,7 @@ hastd_primary(struct hast_resource *res) pid = fork(); if (pid < 0) { KEEP_ERRNO((void)pidfile_remove(pfh)); - primary_exit(EX_OSERR, "Unable to fork"); + primary_exit(EX_TEMPFAIL, "Unable to fork"); } if (pid > 0) { Modified: stable/8/sbin/hastd/proto.c ============================================================================== --- stable/8/sbin/hastd/proto.c Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/proto.c Sat May 1 19:16:08 2010 (r207479) @@ -30,7 +30,9 @@ #include __FBSDID("$FreeBSD$"); +#include #include +#include #include #include @@ -247,6 +249,30 @@ proto_remote_address(const struct proto_ conn->pc_proto->hp_remote_address(conn->pc_ctx, addr, size); } +int +proto_timeout(const struct proto_conn *conn, int timeout) +{ + struct timeval tv; + int fd; + + assert(conn != NULL); + assert(conn->pc_magic == PROTO_CONN_MAGIC); + assert(conn->pc_proto != NULL); + + fd = proto_descriptor(conn); + if (fd < 0) + return (-1); + + tv.tv_sec = timeout; + tv.tv_usec = 0; + if (setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)) < 0) + return (-1); + if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0) + return (-1); + + return (0); +} + void proto_close(struct proto_conn *conn) { Modified: stable/8/sbin/hastd/proto.h ============================================================================== --- stable/8/sbin/hastd/proto.h Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/proto.h Sat May 1 19:16:08 2010 (r207479) @@ -49,6 +49,7 @@ void proto_local_address(const struct pr size_t size); void proto_remote_address(const struct proto_conn *conn, char *addr, size_t size); +int proto_timeout(const struct proto_conn *conn, int timeout); void proto_close(struct proto_conn *conn); #endif /* !_PROTO_H_ */ Modified: stable/8/sbin/hastd/proto_common.c ============================================================================== --- stable/8/sbin/hastd/proto_common.c Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/proto_common.c Sat May 1 19:16:08 2010 (r207479) @@ -58,7 +58,7 @@ proto_common_send(int fd, const unsigned if (done == 0) return (ENOTCONN); else if (done < 0) { - if (errno == EAGAIN) + if (errno == EINTR) continue; return (errno); } @@ -76,7 +76,7 @@ proto_common_recv(int fd, unsigned char do { done = recv(fd, data, size, MSG_WAITALL); - } while (done == -1 && errno == EAGAIN); + } while (done == -1 && errno == EINTR); if (done == 0) return (ENOTCONN); else if (done < 0) Modified: stable/8/sbin/hastd/proto_tcp4.c ============================================================================== --- stable/8/sbin/hastd/proto_tcp4.c Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/proto_tcp4.c Sat May 1 19:16:08 2010 (r207479) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -47,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include "hast.h" #include "pjdlog.h" #include "proto_impl.h" +#include "subr.h" #define TCP4_CTX_MAGIC 0x7c441c struct tcp4_ctx { @@ -222,18 +224,88 @@ static int tcp4_connect(void *ctx) { struct tcp4_ctx *tctx = ctx; + struct timeval tv; + fd_set fdset; + socklen_t esize; + int error, flags, ret; assert(tctx != NULL); assert(tctx->tc_magic == TCP4_CTX_MAGIC); assert(tctx->tc_side == TCP4_SIDE_CLIENT); assert(tctx->tc_fd >= 0); - if (connect(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sin, - sizeof(tctx->tc_sin)) < 0) { + flags = fcntl(tctx->tc_fd, F_GETFL); + if (flags == -1) { + KEEP_ERRNO(pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_GETFL) failed")); + return (errno); + } + /* + * We make socket non-blocking so we have decided about connection + * timeout. + */ + flags |= O_NONBLOCK; + if (fcntl(tctx->tc_fd, F_SETFL, flags) == -1) { + KEEP_ERRNO(pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_SETFL, O_NONBLOCK) failed")); return (errno); } - return (0); + if (connect(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sin, + sizeof(tctx->tc_sin)) == 0) { + error = 0; + goto done; + } + if (errno != EINPROGRESS) { + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, "connect() failed"); + goto done; + } + /* + * Connection can't be established immediately, let's wait + * for HAST_TIMEOUT seconds. + */ + tv.tv_sec = HAST_TIMEOUT; + tv.tv_usec = 0; +again: + FD_ZERO(&fdset); + FD_SET(tctx->tc_fd, &fdset); + ret = select(tctx->tc_fd + 1, NULL, &fdset, NULL, &tv); + if (ret == 0) { + error = ETIMEDOUT; + goto done; + } else if (ret == -1) { + if (errno == EINTR) + goto again; + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, "select() failed"); + goto done; + } + assert(ret > 0); + assert(FD_ISSET(tctx->tc_fd, &fdset)); + esize = sizeof(error); + if (getsockopt(tctx->tc_fd, SOL_SOCKET, SO_ERROR, &error, + &esize) == -1) { + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, + "getsockopt(SO_ERROR) failed"); + goto done; + } + if (error != 0) { + pjdlog_common(LOG_DEBUG, 1, error, + "getsockopt(SO_ERROR) returned error"); + goto done; + } + error = 0; +done: + flags &= ~O_NONBLOCK; + if (fcntl(tctx->tc_fd, F_SETFL, flags) == -1) { + if (error == 0) + error = errno; + pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_SETFL, ~O_NONBLOCK) failed"); + } + return (error); } static int Modified: stable/8/sbin/hastd/secondary.c ============================================================================== --- stable/8/sbin/hastd/secondary.c Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/secondary.c Sat May 1 19:16:08 2010 (r207479) @@ -337,6 +337,12 @@ hastd_secondary(struct hast_resource *re setproctitle("%s (secondary)", res->hr_name); + /* Error in setting timeout is not critical, but why should it fail? */ + if (proto_timeout(res->hr_remotein, 0) < 0) + pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); + if (proto_timeout(res->hr_remoteout, res->hr_timeout) < 0) + pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); + init_local(res); init_remote(res, nvin); init_environment(); Modified: stable/8/sbin/hastd/token.l ============================================================================== --- stable/8/sbin/hastd/token.l Sat May 1 19:12:37 2010 (r207478) +++ stable/8/sbin/hastd/token.l Sat May 1 19:16:08 2010 (r207479) @@ -48,6 +48,7 @@ control { DP; return CONTROL; } listen { DP; return LISTEN; } port { DP; return PORT; } replication { DP; return REPLICATION; } +timeout { DP; return TIMEOUT; } resource { DP; return RESOURCE; } name { DP; return NAME; } local { DP; return LOCAL; } From owner-svn-src-all@FreeBSD.ORG Sat May 1 19:53:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF6DD1065675; Sat, 1 May 2010 19:53:15 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id DF3698FC1E; Sat, 1 May 2010 19:53: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 o41JrFRb025312; Sat, 1 May 2010 19:53:15 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41JrFxW025308; Sat, 1 May 2010 19:53:15 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201005011953.o41JrFxW025308@svn.freebsd.org> From: Martin Matuska Date: Sat, 1 May 2010 19:53: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: r207480 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 19:53:16 -0000 Author: mm Date: Sat May 1 19:53:15 2010 New Revision: 207480 URL: http://svn.freebsd.org/changeset/base/207480 Log: Change description of tunable group vfs.zfs.txg to be more understandable. Approved by: pjd, delphij (mentor) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sat May 1 19:16:08 2010 (r207479) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sat May 1 19:53:15 2010 (r207480) @@ -40,7 +40,8 @@ int zfs_txg_timeout = 30; /* max seconds extern int zfs_txg_synctime; SYSCTL_DECL(_vfs_zfs); -SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0, "ZFS TXG"); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0, + "ZFS transaction groups (TXG)"); TUNABLE_INT("vfs.zfs.txg.timeout", &zfs_txg_timeout); SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeout, CTLFLAG_RDTUN, &zfs_txg_timeout, 0, "Maximum seconds worth of delta per txg"); From owner-svn-src-all@FreeBSD.ORG Sat May 1 20:44:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8916F106566B; Sat, 1 May 2010 20:44:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 788578FC0C; Sat, 1 May 2010 20:44: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 o41Kib8X088277; Sat, 1 May 2010 20:44:37 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41KibtG088275; Sat, 1 May 2010 20:44:37 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201005012044.o41KibtG088275@svn.freebsd.org> From: Martin Matuska Date: Sat, 1 May 2010 20:44: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: r207481 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 20:44:37 -0000 Author: mm Date: Sat May 1 20:44:37 2010 New Revision: 207481 URL: http://svn.freebsd.org/changeset/base/207481 Log: Add sysctl and loader tunable vfs.zfs.txg.write_limit_override. This tunable improves fine-tuning of ZFS write throttling. PR: kern/146108 Suggested by: Nikolay Denev Approved by: pjd, delphij (mentor) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sat May 1 19:53:15 2010 (r207480) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sat May 1 20:44:37 2010 (r207481) @@ -38,6 +38,7 @@ static void txg_quiesce_thread(void *arg int zfs_txg_timeout = 30; /* max seconds worth of delta per txg */ extern int zfs_txg_synctime; +extern uint64_t zfs_write_limit_override; SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0, @@ -48,6 +49,11 @@ SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeo TUNABLE_INT("vfs.zfs.txg.synctime", &zfs_txg_synctime); SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, synctime, CTLFLAG_RDTUN, &zfs_txg_synctime, 0, "Target seconds to sync a txg"); +TUNABLE_QUAD("vfs.zfs.txg.write_limit_override", &zfs_write_limit_override); +SYSCTL_QUAD(_vfs_zfs_txg, OID_AUTO, write_limit_override, CTLFLAG_RW, + &zfs_write_limit_override, 0, + "Override maximum size of a txg to this size in bytes, " + "value of 0 means don't override"); /* * Prepare the txg subsystem. From owner-svn-src-all@FreeBSD.ORG Sat May 1 21:59:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D1BFA106564A; Sat, 1 May 2010 21:59:06 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C1A758FC16; Sat, 1 May 2010 21:59: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 o41Lx6Zw059242; Sat, 1 May 2010 21:59:06 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41Lx6OK059241; Sat, 1 May 2010 21:59:06 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201005012159.o41Lx6OK059241@svn.freebsd.org> From: Ryan Stone Date: Sat, 1 May 2010 21:59: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: r207482 - 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: Sat, 01 May 2010 21:59:06 -0000 Author: rstone Date: Sat May 1 21:59:06 2010 New Revision: 207482 URL: http://svn.freebsd.org/changeset/base/207482 Log: When configuring hwpmc to use the EXT_SNOOP event, only send a default cachestate qualifier on the Atom processor. Other Intel processors do not accept a cachestate qualifier and currently hwpmc will return EINVAL if you try to use the EXT_SNOOP event on those processors Approved by: jkoshy (mentor) MFC after: 2 weeks Modified: head/lib/libpmc/libpmc.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Sat May 1 20:44:37 2010 (r207481) +++ head/lib/libpmc/libpmc.c Sat May 1 21:59:06 2010 (r207482) @@ -737,9 +737,16 @@ iap_allocate_pmc(enum pmc_event pe, char case PMC_EV_IAP_EVENT_40H: /* Core */ case PMC_EV_IAP_EVENT_41H: /* Core */ case PMC_EV_IAP_EVENT_42H: /* Core, Core2, Atom */ - case PMC_EV_IAP_EVENT_77H: /* Core */ if (cachestate == 0) cachestate = (0xF << 8); + break; + case PMC_EV_IAP_EVENT_77H: /* Atom */ + /* IAP_EVENT_77H only accepts a cachestate qualifier on the + * Atom processor + */ + if(cpu_info.pm_cputype == PMC_CPU_INTEL_ATOM && cachestate == 0) + cachestate = (0xF << 8); + break; default: break; } From owner-svn-src-all@FreeBSD.ORG Sat May 1 22:00:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32319106566C; Sat, 1 May 2010 22:00:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 21AA38FC19; Sat, 1 May 2010 22:00:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o41M0Ttk059604; Sat, 1 May 2010 22:00:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41M0TUI059601; Sat, 1 May 2010 22:00:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005012200.o41M0TUI059601@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 1 May 2010 22:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207483 - head/usr.bin/pathchk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 22:00:29 -0000 Author: jilles Date: Sat May 1 22:00:28 2010 New Revision: 207483 URL: http://svn.freebsd.org/changeset/base/207483 Log: pathchk: Add the new POSIX -P option. This option checks for empty pathnames and components starting with '-'. Our -p option also checks for the latter, which remains the case. MFC after: 1 week Modified: head/usr.bin/pathchk/pathchk.1 head/usr.bin/pathchk/pathchk.c Modified: head/usr.bin/pathchk/pathchk.1 ============================================================================== --- head/usr.bin/pathchk/pathchk.1 Sat May 1 21:59:06 2010 (r207482) +++ head/usr.bin/pathchk/pathchk.1 Sat May 1 22:00:28 2010 (r207483) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 21, 2002 +.Dd May 1, 2010 .Dt PATHCHK 1 .Os .Sh NAME @@ -35,7 +35,7 @@ .Nd check pathnames .Sh SYNOPSIS .Nm -.Op Fl p +.Op Fl pP .Ar pathname ... .Sh DESCRIPTION The @@ -95,6 +95,16 @@ No component may start with the hyphen .Pq Ql \&- character. .El +.It Fl P +In addition to the default or +.Fl p +checks, write a diagnostic for each argument that: +.Bl -bullet +.It +Is empty. +.It +Contains a component that starts with a hyphen. +.El .El .Sh EXIT STATUS .Ex -std Modified: head/usr.bin/pathchk/pathchk.c ============================================================================== --- head/usr.bin/pathchk/pathchk.c Sat May 1 21:59:06 2010 (r207482) +++ head/usr.bin/pathchk/pathchk.c Sat May 1 22:00:28 2010 (r207483) @@ -51,6 +51,7 @@ static int portable(const char *); static void usage(void); static int pflag; /* Perform portability checks */ +static int Pflag; /* Check for empty paths, leading '-' */ int main(int argc, char *argv[]) @@ -58,11 +59,14 @@ main(int argc, char *argv[]) int ch, rval; const char *arg; - while ((ch = getopt(argc, argv, "p")) > 0) { + while ((ch = getopt(argc, argv, "pP")) > 0) { switch (ch) { case 'p': pflag = 1; break; + case 'P': + Pflag = 1; + break; default: usage(); /*NOTREACHED*/ @@ -102,6 +106,15 @@ check(const char *path) p = pathd; + if (Pflag && *p == '\0') { + warnx("%s: empty pathname", path); + goto bad; + } + if ((Pflag || pflag) && (*p == '-' || strstr(p, "/-") != NULL)) { + warnx("%s: contains a component starting with '-'", path); + goto bad; + } + if (!pflag) { errno = 0; namemax = pathconf(*p == '/' ? "/" : ".", _PC_NAME_MAX); @@ -182,9 +195,6 @@ portable(const char *path) "0123456789._-"; long s; - if (*path == '-') - return (*path); - s = strspn(path, charset); if (path[s] != '\0') return (path[s]); From owner-svn-src-all@FreeBSD.ORG Sat May 1 22:04:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 932E2106566B; Sat, 1 May 2010 22:04:59 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 82DBB8FC15; Sat, 1 May 2010 22:04:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o41M4xgv060671; Sat, 1 May 2010 22:04:59 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41M4wZ5060669; Sat, 1 May 2010 22:04:58 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201005012204.o41M4wZ5060669@svn.freebsd.org> From: Ryan Stone Date: Sat, 1 May 2010 22:04: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: r207484 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 22:04:59 -0000 Author: rstone Date: Sat May 1 22:04:58 2010 New Revision: 207484 URL: http://svn.freebsd.org/changeset/base/207484 Log: When configuring a system-wide couting PMC, hwpmc was incorrectly logging process mappings for that PMC. Nothing ever reads pmc logs out of a counting PMC, so the log buffers were leaked when the PMC was deconfigured. The process mappings are only useful for sampling PMCs anyway, so only log the mappings if the PMC is a sampling PMC. This bug would cause allocating sample-mode PMCs to fail with ENOMEM after allocating several counting-mode PMCs. Approved by: jkoshy (mentor) MFC after: 2 weeks Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat May 1 22:00:28 2010 (r207483) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat May 1 22:04:58 2010 (r207484) @@ -2675,16 +2675,16 @@ pmc_start(struct pmc *pm) PMCDBG(PMC,OPS,1, "po=%p in global list", po); } po->po_sscount++; - } - /* - * Log mapping information for all existing processes in the - * system. Subsequent mappings are logged as they happen; - * see pmc_process_mmap(). - */ - if (po->po_logprocmaps == 0) { - pmc_log_all_process_mappings(po); - po->po_logprocmaps = 1; + /* + * Log mapping information for all existing processes in the + * system. Subsequent mappings are logged as they happen; + * see pmc_process_mmap(). + */ + if (po->po_logprocmaps == 0) { + pmc_log_all_process_mappings(po); + po->po_logprocmaps = 1; + } } /* From owner-svn-src-all@FreeBSD.ORG Sat May 1 22:10:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0BC31065680; Sat, 1 May 2010 22:10:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 906758FC19; Sat, 1 May 2010 22:10: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 o41MAjT1061938; Sat, 1 May 2010 22:10:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41MAj59061936; Sat, 1 May 2010 22:10:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005012210.o41MAj59061936@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 1 May 2010 22:10: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: r207485 - head/usr.bin/pathchk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 22:10:45 -0000 Author: jilles Date: Sat May 1 22:10:45 2010 New Revision: 207485 URL: http://svn.freebsd.org/changeset/base/207485 Log: pathchk(1): Fix the example so it allows arbitrary pathnames. Spaces and various other characters in pathnames are not passed through literally by xargs in its default mode. Instead, use find . -exec ... {} + Although the -- argument is not strictly required here, add it anyway to avoid surprises when modifying the code to find -f -somedir ... MFC after: 1 week Modified: head/usr.bin/pathchk/pathchk.1 Modified: head/usr.bin/pathchk/pathchk.1 ============================================================================== --- head/usr.bin/pathchk/pathchk.1 Sat May 1 22:04:58 2010 (r207484) +++ head/usr.bin/pathchk/pathchk.1 Sat May 1 22:10:45 2010 (r207485) @@ -114,7 +114,7 @@ other .Tn POSIX systems: .Pp -.Dl "find . -print | xargs pathchk -p" +.Dl "find . -exec pathchk -p -- {} +" .Sh SEE ALSO .Xr getconf 1 , .Xr pathconf 2 , From owner-svn-src-all@FreeBSD.ORG Sat May 1 23:25:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 497C1106564A; Sat, 1 May 2010 23:25:54 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 384B98FC0A; Sat, 1 May 2010 23:25: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 o41NPsJ9078247; Sat, 1 May 2010 23:25:54 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o41NPsrY078245; Sat, 1 May 2010 23:25:54 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201005012325.o41NPsrY078245@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 1 May 2010 23:25: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: r207486 - stable/8/sys/dev/bwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 01 May 2010 23:25:54 -0000 Author: weongyo Date: Sat May 1 23:25:53 2010 New Revision: 207486 URL: http://svn.freebsd.org/changeset/base/207486 Log: MFC r207176: ifp->if_ipackets++ when RX packet interrupts are occurred. Modified: stable/8/sys/dev/bwn/if_bwn.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/bwn/if_bwn.c ============================================================================== --- stable/8/sys/dev/bwn/if_bwn.c Sat May 1 22:10:45 2010 (r207485) +++ stable/8/sys/dev/bwn/if_bwn.c Sat May 1 23:25:53 2010 (r207486) @@ -9413,6 +9413,8 @@ bwn_rxeof(struct bwn_mac *mac, struct mb rssi = rxhdr->phy.abg.rssi; /* XXX incorrect RSSI calculation? */ noise = mac->mac_stats.link_noise; + ifp->if_ipackets++; + BWN_UNLOCK(sc); ni = ieee80211_find_rxnode(ic, wh);